Results of 1 - 9 of about 9 for func (0.002 sec.)
- Write User Defined Functions 13319
- 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 ; i...n each case the function is then callable from SQL like any built-in. The sections below build and register each. Scalar Functions A scalar fun...ction is a Go type that implements the duckdb.ScalarFunc interface, which has two methods: Config() returns a duckdb.ScalarFuncConfig declaring the input parameter types, the resu... - https://man.mtool.work/duckdb/2.0/clients/go/functions.html
- Write User Defined Functions 10497
- Overview The Rust client can register user-defined functions written in Rust: scalar functions with the vscalar feature and table functions with the vtab feature. Both operate on DuckDB's columnar data chunks, so a single call processes a b
...s. The sections below build and register each, then point to a template for packaging them as a loadable extension. Scalar Functions A scalar function is a type that implements the VScalar trait, registered on a connection with register_scalar_functi...on() . DuckDB calls the function's invoke() once per data chunk, passing a batch of input rows and expecting the corresponding output values written ba...utput vector: use duckdb::{ Connection, Result, core::{DataChunkHandle, LogicalTypeHandle, LogicalTypeId}, vscalar::{ScalarFunctionSignature, VScalar}, vtab::arrow::WritableVector, }; struct AddOne; impl VScalar for AddOne { // No per-function state... - https://man.mtool.work/duckdb/2.0/clients/rust/functions.html
- ADBC Client 9526
- Installation To use the DuckDB ADBC client, download the libduckdb archive for your platform and follow the instructions below . For Python, install the duckdb package instead, as described in the Python section . The latest stable version
...e refer to the ADBC documentation page for a more extensive discussion on ADBC and a detailed API explanation. Implemented Functionality The DuckDB-ADBC driver implements the full ADBC specification, with the exception of the ConnectionReadPartition..., StatementExecutePartitions and StatementSetSubstraitPlan functions. The first two exist to support systems that internally partition the query results, which does not apply to DuckDB....Substrait plans are not supported. In this section, we will describe the main functions that exist in ADBC, along with the arguments they take and provide examples for each function. Database Set of functi... - https://man.mtool.work/duckdb/2.0/clients/adbc.html
- Python Function API 8394
- You can create a DuckDB user-defined function (UDF) from a Python function so it can be used in SQL queries. Similarly to regular functions , they need to have a name, a return type and parameter types. Creating Functions To register a Pyth
...on UDF, use the create_function method from a DuckDB connection: import duckdb def add_one(x: int) -> int: return x + 1 con = duckdb.connect() con.cre...ate_function("add_one", add_one) print(con.sql("SELECT add_one(41)").fetchall()) [(42,)] UDFs need NumPy. Without the numpy package..., create_function raises InvalidInputException: 'numpy' is required for this operation, but it wasn't installed . The signature is creat... - https://man.mtool.work/duckdb/2.0/clients/python/function.html
- Swift Client 8394
- DuckDB has a Swift client. See the announcement post for details. Instantiating DuckDB DuckDB supports both in-memory and persistent databases. To work with an in-memory database, run: let database = try Database(store: .inMemory) To work w
...DuckDB import Foundation final class ExoplanetStore { // Factory method to create and prepare a new ExoplanetStore static func create() async throws -> ExoplanetStore { // Create our database and connection as described above let database = try Data...onnection: Connection) { ... } } Querying the Database The following example queries DuckDB from within Swift via an async function. This means the callee won't be blocked while the query is executing. We'll then cast the result columns to Swift nati...Data framework. ... import TabularData extension ExoplanetStore { // Retrieves the number of exoplanets discovered by year func groupedByDiscoveryYear() async throws -> DataFrame { // Issue the query we described above let result = try connection.que... - https://man.mtool.work/duckdb/2.0/clients/tertiary_clients/swift.html
- Profile and Monitor 7747
- 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
...nector.Close() err = duckdb.RegisterLogStorage(connector, "my_log_storage", duckdb.LoggerCallbacks{ DefaultLoggerCallback: func(level, logType, logMsg string) { log.Printf("[%s] %s: %s", level, logType, logMsg) }, }) check(err) // Enable logging, the... - https://man.mtool.work/duckdb/2.0/clients/go/profiling.html
- Connect 7675
- Overview The Go client works through the standard database/sql types: a *sql.DB is a pool of connections to a DuckDB database. This page covers opening in-memory and file-backed databases, passing DuckDB configuration options, running initi
...ach new connection, which is where boot queries belong: connector, err := duckdb.NewConnector("/path/to/foo.db?threads=4", func(execer driver.ExecerContext) error { bootQueries := []string{ "SET schema = 'main'", "SET search_path = 'main'", } for _,...Local Operations Some features are scoped to a single connection rather than the pool: profiling, registering user-defined functions, and the Appender all act on one connection. Check a connection out of the pool with db.Conn() , which returns a *sql... - https://man.mtool.work/duckdb/2.0/clients/go/connecting.html
- Import Data 7675
- Overview The Go client offers two ways to load data into DuckDB in bulk: the high-performance Appender for inserting rows generated in Go, and reading directly from data files such as Parquet, CSV, and JSON. Both are described below. For in
...appends a row, then reads it back: package main import ( "context" "database/sql" "log" "github.com/duckdb/duckdb-go/v2" ) func main() { c, err := duckdb.NewConnector("", nil) if err != nil { log.Fatal(err) } defer c.Close() con, err := c.Connect(con...readers are among the bundled extensions , no extra installation is needed. Query a file in place with the matching table function: rows, err := db.QueryContext(ctx, `SELECT * FROM read_parquet('data.parquet')`) The same pattern reads CSV with read_... - https://man.mtool.work/duckdb/2.0/clients/go/data_import.html
- Go Client 7585
- The latest stable release of the DuckDB Go client bundles DuckDB 2.0.0. Its own version tag encodes that DuckDB version; see Versioning below. The DuckDB Go client, duckdb-go , is a SQL driver that conforms to Go's built-in database/sql int
...tabase. On top of database/sql , the client adds DuckDB-specific interfaces for the Appender , Apache Arrow , user-defined functions , and profiling . This page focuses on installation. The other pages in this section cover connecting and each featur.../duckdb-go/v2" ) The import registers a driver named duckdb with database/sql . Code that calls the client's own types and functions directly, such as the Appender or user-defined functions, imports the package under its duckdb name instead of with t...or any database/sql driver: package main import ( "database/sql" "errors" "fmt" "log" _ "github.com/duckdb/duckdb-go/v2" ) func main() { db, err := sql.Open("duckdb", "") if err != nil { log.Fatal(err) } defer db.Close() _, err = db.Exec(`CREATE TABL... - https://man.mtool.work/duckdb/2.0/clients/go/overview.html
PREV
1
NEXT
DuckDB 2.0 Documentation / man.mtool.work