Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
crawshaw.io/sqlite
This package provides a low-level Go interface to SQLite 3. Connections are pooled and if the SQLite shared cache mode is enabled the package takes advantage of the unlock-notify API to minimize the amount of handling user code needs for dealing with database lock contention.
It has interfaces for some of SQLite's more interesting extensions, such as incremental BLOB I/O and the session extension.
A utility package, sqlitex, provides some higher-level tools for making it easier to perform common tasks with SQLite. In particular it provides support to make nested transactions easy to use via sqlitex.Save.
This is not a database/sql driver.
go get -u crawshaw.io/sqlite
A HTTP handler that uses a multi-threaded pool of SQLite connections via a shared cache.
var dbpool *sqlitex.Pool
func main() {
var err error
dbpool, err = sqlitex.Open("file:memory:?mode=memory", 0, 10)
if err != nil {
log.Fatal(err)
}
http.HandleFunc("/", handler)
log.Fatal(http.ListenAndServe(":8080", nil))
}
func handler(w http.ResponseWriter, r *http.Request) {
conn := dbpool.Get(r.Context())
if conn == nil {
return
}
defer dbpool.Put(conn)
stmt := conn.Prep("SELECT foo FROM footable WHERE id = $id;")
stmt.SetText("$id", "_user_id_")
for {
if hasRow, err := stmt.Step(); err != nil {
// ... handle error
} else if !hasRow {
break
}
foo := stmt.GetText("foo")
// ... use foo
}
}
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.