Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
trilogy_w_prepared_statements
Advanced tools
Ruby bindings to the Trilogy client library
Add this line to your application's Gemfile:
gem 'trilogy'
And then execute:
$ bundle
Or install it yourself as:
$ gem install trilogy
client = Trilogy.new(host: "127.0.0.1", port: 3306, username: "root", read_timeout: 2)
if client.ping
client.query_options[:database_timezone] = :utc
client.change_db "mydb"
result = client.query("SELECT id, created_at FROM users LIMIT 10")
result.each_hash do |user|
p user
end
# Multi-statement
results = []
results << client.query("SELECT name FROM users WHERE id = 1; SELECT name FROM users WHERE id = 2")
results << client.next_result while client.more_results_exist?
end
You should use the rake commands to build/install/release the gem For instance:
bundle exec rake build
The official Ruby bindings are inside of the canonical trilogy repository itself.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)The trilogy API was heavily inspired by the mysql2 gem but has a few notable differences:
query_options
hash doesn't inherit from the connection options hash.
This means that options like turning on/of casting will need to be set before
a query and not passed in at connect time.application_timezone
query option. If
casting is enabled and your database timezone is different than what the
application is expecting you'll need to do the conversion yourself later.Encoding.default_internal
is done. Similarly to not automatically converting
Time objects from database_timezone
into application_timezone
, we leave
the transcoding step up to the caller.as
query option. Calling Trilogy::Result#each
will yield an array
of row values. If you want a hash you should use Trilogy::Result#each_hash
.FAQs
Unknown package
We found that trilogy_w_prepared_statements demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.