### Install and Load Quack Extension Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/README.md Use these SQL commands to manually install and load the Quack extension if it does not autoinstall. ```sql INSTALL quack; LOAD quack; ``` -------------------------------- ### Setup VCPKG for Dependency Management Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/README.md Enables VCPKG using the provided makefile target and sets the VCPKG toolchain path environment variable. ```shell make setup-vcpkg export VCPKG_TOOLCHAIN_PATH=`pwd`/vcpkg/scripts/buildsystems/vcpkg.cmake ``` -------------------------------- ### Start DuckDB RPC Server (HTTP) Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Starts an RPC server using plain HTTP without TLS. The listen URI and an authentication token are returned. ```sql CALL rpc_start('quack:localhost', disable_ssl => true); ``` -------------------------------- ### Start Quack Server and Create Table Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/README.md Initiates the Quack server on a DuckDB instance and creates a local table. The server requires a network address and an optional token. ```sql CALL quack_serve('quack:localhost', token = 'super_secret'); CREATE TABLE hello AS FROM VALUES ('world') v(s); ``` -------------------------------- ### Start DuckDB RPC Server (HTTPS) Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Starts an RPC server using HTTPS. Generates self-signed TLS keys if they don't exist. The listen URI and an authentication token are returned. ```sql CALL rpc_generate_keys(); CALL rpc_start('quack:localhost'); ``` -------------------------------- ### Copy Data from Client to Server Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/README.md Demonstrates creating a table on the client that is then accessible on the server. ```sql -- on client CREATE TABLE remote.hello2 AS FROM VALUES ('world2') v(s); ``` -------------------------------- ### Access Client-Created Table on Server Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/README.md Shows how to query a table created on the client from the server instance. ```sql -- on server FROM hello2; ``` -------------------------------- ### Explain Pushdown on Remote Table Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Uses the EXPLAIN command to verify that projection and filter pushdown are working correctly for a query against a remote table via the 'rpc' catalog. ```sql EXPLAIN SELECT i FROM rpc.main.test_data WHERE i = 42; ``` -------------------------------- ### Run All SQLLogicTests Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/test/README.md Execute all SQLLogicTests for the extension. This command builds and runs the tests. ```bash make test ``` -------------------------------- ### Build the Quack Extension Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/README.md Compiles the extension using the make command. This generates the DuckDB shell binary, the test runner, and the loadable extension binary. ```bash make ``` -------------------------------- ### Main Binaries Built by Make Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/README.md Lists the primary executables generated after a successful build, including the DuckDB shell, unittest runner, and the quack extension binary. ```bash ./build/release/duckdb ./build/release/test/unittest ./build/release/extension/quack/quack.duckdb_extension ``` -------------------------------- ### Connect to Quack Server and Query Remote Table Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/README.md On a client instance, create a secret for authentication, attach to the server, and query a table from the remote server. ```sql CREATE SECRET (TYPE quack, TOKEN 'super_secret'); ATTACH 'quack:localhost' AS remote; FROM remote.hello; ``` -------------------------------- ### Query Remote Table with Filter and Projection Pushdown Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Scans a remote table 'fuu' in the 'main' schema of the 'rpc' catalog, applying a filter and projection. Pushdown ensures only necessary data is transferred and processed server-side. ```sql FROM rpc.main.fuu WHERE col0 = 42; ``` -------------------------------- ### Stateless Query with rpc_call (HTTP) Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Executes a SQL query against a remote RPC server using plain HTTP. The result is streamed back to the client. ```sql FROM rpc_call('quack:localhost', 'SELECT 42', disable_ssl => true); ``` -------------------------------- ### Enable and Query RPC Logs Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Enable the 'RPC' log to capture detailed information about RPC messages. Query the parsed logs using `duckdb_logs_parsed('RPC')` to analyze request details and identify issues. ```sql CALL enable_logging('RPC'); FROM rpc_call('quack:localhost', 'SELECT 42'); SELECT * FROM duckdb_logs_parsed('RPC'); ``` -------------------------------- ### Ad-hoc SQL via Attached Catalog Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Executes an ad-hoc SQL query against the remote server through the attached 'rpc' catalog using the 'call' table macro. ```sql FROM rpc.call('SELECT 42'); ``` -------------------------------- ### Attach Remote Database (HTTP) Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Attaches a remote RPC server as a catalog named 'rpc' using plain HTTP. This allows querying remote tables as if they were local. ```sql ATTACH 'quack:localhost' AS rpc (disable_ssl true); ``` -------------------------------- ### Stateless Query with rpc_call (HTTPS) Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Executes a SQL query against a remote RPC server using HTTPS. The result is streamed back to the client. ```sql FROM rpc_call('quack:localhost', 'SELECT 42'); ``` -------------------------------- ### Enable and Query HTTP Logs Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Enable the 'HTTP' log to monitor the underlying HTTP transport layer. Query the parsed logs to inspect request types, URLs, and response statuses for debugging HTTP communication. ```sql CALL enable_logging('HTTP'); FROM rpc_call('quack:localhost', 'SELECT 1'); SELECT request.type, request.url, response.status FROM duckdb_logs_parsed('HTTP'); ``` -------------------------------- ### Run All SQLLogicTests in Debug Mode Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/test/README.md Execute all SQLLogicTests for the extension in debug mode. This command builds and runs the tests with debugging enabled. ```bash make test_debug ``` -------------------------------- ### Define Quack Storage Library Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/src/storage/CMakeLists.txt Defines the Quack storage library as an OBJECT library, listing all its source files. This is a standard CMake command for library creation. ```cmake add_library( quack_storage OBJECT quack_catalog.cpp quack_catalog_set.cpp quack_insert.cpp quack_optimizer.cpp quack_table.cpp quack_schema.cpp quack_transaction.cpp quack_transaction.cpp quack_transaction_manager.cpp quack_view.cpp) ``` -------------------------------- ### Persist RPC Logs to File Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Configure the 'RPC' log to persist its output to a file for long-term storage and analysis. This is useful for non-trivial sessions where in-memory logs might be insufficient. ```sql CALL enable_logging( 'RPC', storage => 'file', storage_config => {'path': '/tmp/duckdb-rpc-logs'} ); ``` -------------------------------- ### Set Default RPC Authentication Token Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Sets the session variable 'rpc_default_token' to the authentication token obtained from 'rpc_start'. This is required for clients to connect to servers using the default authentication function. ```sql SET rpc_default_token = ''; ``` -------------------------------- ### Create Table on Remote Database Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Creates a new table named 't' on the remote database via the attached 'rpc' catalog. This demonstrates DDL capabilities over RPC. ```sql CREATE TABLE rpc.t AS FROM range(10); ``` -------------------------------- ### Query Remote Table via Attached Catalog Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Scans a remote table named 'fuu' within the attached 'rpc' catalog. Supports projection and filter pushdown. ```sql FROM rpc.fuu; ``` -------------------------------- ### Set Extension Sources with Library Objects Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/src/storage/CMakeLists.txt Appends the compiled objects of the 'quack_storage' library to the 'EXTENSION_SOURCES' variable, making them available to the parent scope. This is crucial for linking the extension. ```cmake set(EXTENSION_SOURCES ${EXTENSION_SOURCES} $ PARENT_SCOPE) ``` -------------------------------- ### Attach Remote Database (HTTPS) Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Attaches a remote RPC server as a catalog named 'rpc' using HTTPS. This allows querying remote tables as if they were local. ```sql ATTACH 'quack:localhost' AS rpc; ``` -------------------------------- ### Execute Transaction on Remote Database Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Initiates and commits a transaction on the remote database via the attached 'rpc' catalog. Transactions are forwarded to the server. ```sql BEGIN; ... COMMIT; ``` -------------------------------- ### Stop DuckDB RPC Server Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Stops the RPC server listening on the specified URI. ```sql CALL rpc_stop('quack:localhost'); ``` -------------------------------- ### Insert Data into Remote Table Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Inserts data into a table named 't' on the remote database via the attached 'rpc' catalog. This demonstrates write capabilities over RPC. ```sql INSERT INTO rpc.t VALUES (42); ``` -------------------------------- ### Detach Remote Database Source: https://github.com/duckdb/duckdb-quack/blob/v1.5-variegata/docs/usage.md Detaches the remote RPC catalog named 'rpc' from the current DuckDB session. ```sql DETACH rpc; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.