⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 10 of about 82 for check (0.002 sec.)
Write User Defined Functions 12723
Overview The Go client can register user-defined functions written in Go: scalar functions that map input rows to a single output value, and table functions that produce a set of rows. It can also register a replacement scan that rewrites a ... n unresolved table name into a query. Scalar and table functions are registered on a connection checked out with db.Conn() , while a replacement scan is registered on a Connector ; in each case the function is then callable ... n struct{} func (*varcharLen) Config() duckdb.ScalarFuncConfig { inputType, err := duckdb.NewTypeInfo(duckdb.TYPE_VARCHAR) check(err) resultType, err := duckdb.NewTypeInfo(duckdb.TYPE_INTEGER) check(err) return duckdb.ScalarFuncConfig{ InputTypeInfos: ... er.Value) (any, error) { return int32(len(values[0].(string))), nil }, } } func main() { db, err := sql.Open("duckdb", "") check(err) defer db.Close() conn, err := db.Conn(context.Background()) check(err) defer conn.Close() var udf *varcharLen check(d ...
https://man.mtool.work/duckdb/2.0/clients/go/functions.html
Profile and Monitor 12055
Overview The Go client can observe query execution: it can retrieve per-operator profiling metrics after a query runs, and register a log storage that receives DuckDB's log messages. Both are described below. Profiling Profiling information ... is connection-local, so it is read from a *sql.Conn checked out with db.Conn() . Enable profiling on that connection with the enable_profiling setting , run the query to profile, t ... hen read the result with duckdb.GetProfilingInfo() : db, err := sql.Open("duckdb", "") check(err) defer db.Close() conn, err := db.Conn(context.Background()) check(err) defer conn.Close() // Do not print profiling o ... utput to stdout after each query. _, err = conn.ExecContext(context.Background(), `SET enable_profiling = 'no_output'`) check(err) // Run the query to profile. res, err := conn.QueryContext(context.Background(), `SELECT 42`) check(err) res.Close() ...
https://man.mtool.work/duckdb/2.0/clients/go/profiling.html
CREATE TABLE Statement 11320
The CREATE TABLE statement creates a table in the catalog. Examples Create a table with two integer columns ( i and j ): CREATE TABLE t1 (i INTEGER, j INTEGER); Create a table with a primary key: CREATE TABLE t1 (id INTEGER PRIMARY KEY, j V ... various different types, constraints and default values: CREATE TABLE t1 ( i INTEGER NOT NULL DEFAULT 0, decimalnr DOUBLE CHECK (decimalnr < 10), date DATE UNIQUE, time TIMESTAMP ); Create table with CREATE TABLE ... AS SELECT (CTAS): CREATE TABLE t1 ... ATE TABLE t1 AS FROM t2 LIMIT 0; It is not possible to create tables using CTAS statements with constraints (primary keys, check constraints, etc.). Check Constraints A CHECK constraint is an expression that must be satisfied by the values of every ro ... w in the table. CREATE TABLE t1 ( id INTEGER PRIMARY KEY, percentage INTEGER CHECK (0 <= percentage AND percentage <= 100) ); INSERT INTO t1 VALUES (1, 5); INSERT INTO t1 VALUES (2, -1); Constraint Error: ...
https://man.mtool.work/duckdb/2.0/sql/statements/create_table.html
ODBC 101: A Duck Themed Guide to ODBC 10734
What is ODBC? ODBC which stands for Open Database Connectivity, is a standard that allows different programs to talk to different databases including, of course, DuckDB. This makes it easier to build programs that work with many different d ... hich represents the success or failure of the function. This allows for easy error handling, as the application can simply check the return code of each function call to determine if it was successful. When unsuccessful, the application can then use t ... ches the results, and prints them. It also disconnects from the database and frees the handles, and includes a function to check the return value of ODBC functions. It also includes a CMakeLists.txt file that can be used to build the application. Samp ... le .cpp File #include <iostream> #include <sql.h> #include <sqlext.h> void check_ret(SQLRETURN ret, std::string msg) { if (ret != SQL_SUCCESS && ret != SQL_SUCCESS_WITH_INFO) { std::cout << ret << ": " < ...
https://man.mtool.work/duckdb/2.0/guides/odbc/general.html
Building Configuration 9617
Build Types DuckDB can be built in many different settings, most of these correspond directly to CMake but not all of them. release This build has been stripped of all the assertions and debug symbols and code, optimized for performance. de ... ebug symbols that make it possible to step through the execution with line number information and D_ASSERT lines are still checked in this build. Binaries of this build mode are significantly faster than those of the debug mode. reldebug This build is ... sertions are also stripped in this build. benchmark This build is a shorthand for release with BUILD_BENCHMARK=1 set. tidy-check This creates a build and then runs Clang-Tidy to check for issues or style violations through static analysis. The CI will ... also run this check, causing it to fail if this check fails. format-fix | format-changes | format-main This doesn't actually create a build, b ...
https://man.mtool.work/duckdb/2.0/dev/building/build_configuration.html
Catch C/C++ Tests 9399
While we prefer the sqllogic tests for testing most functionality, for certain tests only SQL is not sufficient. This typically happens when you want to test the C++ API. When using pure SQL is really not an option it might be necessary to ... uckDB db(storage_database, config.get()); Connection con(db); result = con.Query("SELECT * FROM test ORDER BY a"); REQUIRE(CHECK_COLUMN(result, 0, {Value(), 11, 12, 13})); REQUIRE(CHECK_COLUMN(result, 1, {Value(), 22, 21, 22})); result = con.Query("SE ... LECT * FROM test2 ORDER BY a"); REQUIRE(CHECK_COLUMN(result, 0, {11, 12, 13})); } DeleteDatabase(storage_database); } The test uses the TEST_CASE wrapper to create each ... test. The database is created and queried using the C++ API. Results are checked using either REQUIRE_FAIL / REQUIRE_NO_FAIL (corresponding to statement ok and statement error) or REQUIRE(CHECK_COLUMN( ...
https://man.mtool.work/duckdb/2.0/dev/sqllogictest/catch.html
Constraints 9031
In SQL, constraints can be specified for tables. Constraints enforce certain properties over data that is inserted into a table. Constraints can be specified along with the schema of the table as part of the CREATE TABLE statement . In cert ... they slow down loading and updates but speed up certain queries. Please consult the Performance Guide for details. Syntax Check Constraint Check constraints allow you to specify an arbitrary Boolean expression. Any columns that do not satisfy this ex ... ion violate the constraint. For example, we could enforce that the name column does not contain spaces using the following CHECK constraint. CREATE TABLE students (name VARCHAR CHECK (NOT contains(name, ' '))); INSERT INTO students VALUES ('this name ... contains spaces'); Constraint Error: CHECK constraint failed on table students with expression CHECK((NOT contains("name", ' '))) Not Null Constraint A not-null cons ...
https://man.mtool.work/duckdb/2.0/sql/constraints.html
PEG Parser 8582
New Starting with DuckDB 2.0, the PEG parser is the default parser. In earlier versions it was an experimental, opt-in feature enabled with enable_peg_parser() , which is no longer required or available. DuckDB uses a parser based on PEG ( ... and has a slight performance overhead. This is in the range of milliseconds and is thus negligible for analytical queries. Checking a Query The check_peg_parser table function is a testing utility provided by the autocomplete extension. It runs the PE ... her on a query string without executing the query. It returns a single BOOLEAN column, success , and an empty result: FROM check_peg_parser('SELECT 42'); ┌─────────┐ │ success │ │ boolean │ └─────────┘ 0 rows Note that check_peg_parser does not reliab ... ly report parse failures: in DuckDB 2.0.0, it also returns an empty result for invalid queries such as SELEC 42 . To check whether a query parses without binding or executing it, use the json_serialize_sql function of the json extension, which r ...
https://man.mtool.work/duckdb/2.0/sql/peg_parser.html
PostgreSQL Extension Functions 8514
postgres_clear_cache postgres_configure_pool postgres_execute postgres_hstore_get postgres_hstore_to_json postgres_query read_postgres_binary postgres_clear_cache postgres_clear_cache() -> TABLE Clears cached schema entries (like table name ... the pool. max_lifetime_millis ( UBIGINT ): maximum number of milliseconds the connection can be kept open. This number is checked when the connection is taken from the pool and returned to the pool. When the connection pool reaper thread is enabled ( ... enable_reaper_thread argument), then this number is checked in background periodically. idle_timeout_millis ( UBIGINT ): maximum number of milliseconds the connection can be kept i ... dle in the pool. This number is checked when the connection is taken from the pool. When the connection pool reaper thread is enabled ( enable_reaper_thread opt ...
https://man.mtool.work/duckdb/2.0/core_extensions/postgres/functions.html
Security 8364
This page covers Quack's security posture end to end: what the server exposes, what stays local, the role of a TLS-terminating reverse proxy, and the authentication / authorization callbacks the server runs on every connection and every que ... tion to call as a hook for authentication / authorization: Setting Default Called when quack_authentication_function quack_check_token A new client connects ( CONNECTION_REQUEST ). quack_authorization_function quack_nop_authorization A client issues a ... CHAR, user_name VARCHAR); INSERT INTO quack_tokens VALUES ('alice-key-123', 'alice'), ('bob-key-456', 'bob'); CREATE MACRO check_token(sid, client_token, server_token) AS ( EXISTS (SELECT 1 FROM quack_tokens WHERE auth_token = client_token) ); SET GLO ... BAL quack_authentication_function = 'check_token'; Now any client whose token is in quack_tokens is admitted, everyone else is rejected. Adding / removing users is a ...
https://man.mtool.work/duckdb/2.0/quack/security.html
PREV 1 2 3 4 5 6 7 8 9 NEXT
DuckDB 2.0 Documentation / man.mtool.work