Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
github.com/yokomotod/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]
}
A list of ZetaSQL specifications and features supported by go-zetasqlite.
INT
, SMALLINT
, INTEGER
, BIGINT
, TINYINT
, BYTEINT
)DECIMAL
)BIGDECIMAL
)FLOAT
)BOOLEAN
)+
, -
, ~
)*
)/
)||
)+
)-
)<<
, >>
, &
, |
)=
, <
, >
, <=
, >=
, !=
, <>
)Not suported yet
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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.