
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
github.com/goccy/go-zetasqlite
A database driver library that interprets ZetaSQL queries and runs them using SQLite3
go-zetasqlite
supports database/sql
driver interface.
So, you can use ZetaSQL queries just by importing github.com/goccy/go-zetasqlite
.
Also, go-zetasqlite uses SQLite3 as the database engine.
Since we are using go-sqlite3, we can use the options ( like :memory:
) supported by go-sqlite3
( see details ).
ZetaSQL functionality is provided by go-zetasql
go get github.com/goccy/go-zetasqlite
Since this library uses go-zetasql, the following environment variables must be enabled in order to build. See here for details.
CGO_ENABLED=1
CXX=clang++
You can pass ZetaSQL queries to Query/Exec function of database/sql package.
package main
import (
"database/sql"
"fmt"
_ "github.com/goccy/go-zetasqlite"
)
func main() {
db, err := sql.Open("zetasqlite", ":memory:")
if err != nil {
panic(err)
}
defer db.Close()
rows, err := db.Query(`SELECT * FROM UNNEST([?, ?, ?])`, 1, 2, 3)
if err != nil {
panic(err)
}
var ids []int64
for rows.Next() {
var id int64
if err := rows.Scan(&id); err != nil {
panic(err)
}
ids = append(ids, id)
}
fmt.Println(ids) // [1 2 3]
}
You can execute ZetaSQL queries interactively by using the tools provided by cmd/zetasqlite-cli
. See here for details
A list of ZetaSQL ( Google Standard SQL ) specifications and features supported by go-zetasqlite.
INT
, SMALLINT
, INTEGER
, BIGINT
, TINYINT
, BYTEINT
)DECIMAL
)BIGDECIMAL
)FLOAT
)BOOLEAN
)+
, -
, ~
)*
)/
)||
)+
)-
)<<
, >>
, &
, |
)=
, <
, >
, <=
, >=
, !=
, <>
)User Defined Function
Templated Argument Function
ANY
-> ANY
ARRAY<ANY>
-> ANY
ANY
-> ARRAY<ANY>
INT64
/ DOUBLE
JavaScript UDF
MIT
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.