Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
This is a tiny wrapper around the SQLite C API that's written in RubyMotion. It is intentionally bare so as to limit the surface area of code that interacts with the raw C API (misuse of the C API can cause resource leaks and seg faults). Think of it more as a driver for SQLite than anything else.
Whenever possible, it uses Ruby idioms like blocks and exceptions.
Yes.
db = SQLite3::Database.new(":memory:")
db.execute("CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER)")
db.execute("INSERT INTO test (name, age) VALUES (?, ?)", ["brad", 28])
db.execute("INSERT INTO test (name, age) VALUES (?, ?)", ["sparky", 24])
rows = []
db.execute("SELECT * FROM test") do |row|
rows << row
end
rows.should == [
{ id: 1, name: "brad", age: 28 },
{ id: 2, name: "sparky", age: 24 }
]
# File is stored in your /project/resources/ folder
db = SQLite3::Database.new(File.join(App.resources_path, "my_db.sqlite"))
rows = []
db.execute("SELECT * FROM test ORDER BY id") do |row|
rows << row
end
*this code assumes you're using BubbleWrap for access to App.resources_path
.
execute
to run SQL statements. All SQL statements are first prepared, and parameters can be passed as an Array or a Hash. If a Hash is passed, then the SQLite named parameter syntax is assumed to be in use.execute_debug
to see the SQL statement and paramaters passed in the REPL. You should not use this method in production.execute_scalar
to run SQL statements and return the first column of the first row. This is useful for queries like SELECT COUNT(*) FROM posts
.FAQs
Unknown package
We found that motion-sqlite3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.