
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.
A persistent simple Hash backed by sqlite3
Contains (almost) the same features/API as the Ruby Hash object (v2.0.0)
Add this line to your application's Gemfile:
gem 'sqlite3_hash'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sqlite3_hash
SQLite3Hash is a persistent simple Hash backed by sqlite3.
You can use it like a Hash object, but all data is stored in SQLite3, which can be re-used over multiple instantiations of ruby.
Example case:
require 'rubygems'
require 'sqlite3_hash'
shash = SQLite3Hash.new('tmpfile.db')
shash['int'] = 42
shash[:sym] = { a: 12, b: 32 }
shash[99.1] = [1,[10,20],3]
shash = nil
# Some point later.. or even in another ruby instance:
shash = SQLite3Hash.new('tmpfile.db')
shash['int'] # => 42
shash.to_s # => {"int"=>42, :sym=>{:a=>12, :b=>32}, 99.1=>[1, [10, 20], 3]}
Handles values of String, Fixnum, Float, and anything that can be Marshalled
Keys are anything that can be Marshalled.
This means, for example, that you cannot store Procs in an SQLite3Hash
You can use the same SQLite3 DB for multiple hashes:
require 'rubygems'
require 'sqlite3_hash'
hash1 = SQLite3Hash.new('tmpfile.db','hash1')
hash2 = SQLite3Hash.new('tmpfile.db','hash2')
Contains all the Hash class methods from 2.0.0 except:
For example:
a = [ "a", "b" ]
h = { a => 100 }
sh = SQLite3Hash('tmp.db', h)
a[0] = 'z' # This only effects 'h' not 'sh'
h # => {["z", "b"]=>100}
sh # => {["a", "b"]=>100}
After checking out the repo, run bin/setup
to install dependencies. Then, run bundle exec rspec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
(This should probably someday be rewritten using mixins or inheritance.)
Bug reports and pull requests are welcome on GitHub at https://github.com/daveola/sqlite3_hash.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that sqlite3_hash demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
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.