Results of 1 - 4 of about 4 for QueryRow (0.001 sec.)
- Run Queries 12297
- Overview Because the Go client implements database/sql , queries run through the standard methods: Exec and ExecContext send statements that do not return rows, such as INSERT or DDL, and report the number of affected rows. Query , QueryCon
...text , QueryRow , and QueryRowContext run statements that return rows and hand back a *sql.Rows (or a single *sql.Row ) to scan into Go va...D age > ?`, "macgyver", "marc", 30, ) For named placeholders such as $name , wrap each argument with sql.Named : row := db.QueryRowContext(ctx, "SELECT $age >= 18 AND $name = 'Alice'", sql.Named("age", minAge), sql.Named("name", name), ) Warning Do not u...time.Date(2024, time.April, 5, 0, 0, 0, 0, time.UTC) end := time.Date(2024, time.April, 6, 0, 0, 0, 0, time.UTC) row := db.QueryRow(` SELECT count(*) FROM (VALUES (TIMESTAMP_NS '2024-04-05 12:00:00.000000001')) events(ts) WHERE ts >= ? AND ts < ?`, duckd... - https://man.mtool.work/duckdb/2.0/clients/go/querying.html
- Go Client 9116
- 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
...y: , opens an in-memory database, and a file path opens (or creates) a persistent database. From there, Exec , Query , and QueryRow run statements exactly as they do for any database/sql driver: package main import ( "database/sql" "errors" "fmt" "log" _...= db.Exec(`INSERT INTO people VALUES (42, 'John')`) if err != nil { log.Fatal(err) } var ( id int name string ) row := db.QueryRow(`SELECT id, name FROM people`) err = row.Scan(&id, &name) if errors.Is(err, sql.ErrNoRows) { log.Println("no rows") } else... - https://man.mtool.work/duckdb/2.0/clients/go/overview.html
- Troubleshoot 7896
- Overview This page collects common issues encountered when using the DuckDB Go client, together with their workarounds. Because the client uses cgo to embed DuckDB, most build problems are cgo or linker problems. If you run into a problem t
...estamp type is required, for example binding against a TIMESTAMP_NS column, force the type with duckdb.Typed() : row := db.QueryRow(query, duckdb.Typed(start, duckdb.TYPE_TIMESTAMP_NS), duckdb.Typed(end, duckdb.TYPE_TIMESTAMP_NS), ) See Run Queries for t... - https://man.mtool.work/duckdb/2.0/clients/go/troubleshoot.html
- Write User Defined Functions 7655
- 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
...defer conn.Close() var udf *varcharLen check(duckdb.RegisterScalarUDF(conn, "my_length", udf)) var length int32 row := db.QueryRow(`SELECT my_length('hello world')`) check(row.Scan(&length)) // 11 } Once registered, the function is called from SQL by th... - https://man.mtool.work/duckdb/2.0/clients/go/functions.html
PREV
1
NEXT
DuckDB 2.0 Documentation / man.mtool.work