Noteflakes: Extralite - a new Ruby gem for working with SQLite databases
16-Dec-2021 1336
In the last year I’ve been working a lot with SQLite databases. I started by using the popular sqlite3-ruby Ruby gem, but quickly noticed that for my usage there were a few things missing in the gem’s API. Being a tinkerer, and having had some experience writing C-extensions, I had a look at the SQLite C API and decided to try to write my own Ruby bindings for SQLite. Thus Extralite was born.Extralite is an extra-lightweight (less than 460 lines of C-code) SQLite3 wrapper for Ruby. It provides a single class with a [minimal set of methods] for interacting with an SQLite3 database. Extralite provides the following improvements over the sqlite3-ruby gem:Improved concurrency for multithreaded apps: the Ruby GVL is released while preparing SQL statements and while iterating over results.Super fast - up to 13x faster than sqlite3-ruby.Automatically execute SQL strings containing multiple semicolon-separated queries (handy for creating/modifying schemas).Access data in a variety of ways: rows as hashes, rows as arrays, single row, single column, single value.
Noteflakes: Extralite - a new Ruby gem for working with SQLite databases #ruby #rubydeveloper #rubyonrails #Noteflakes: #Extralite #working #SQLite #databases #databases #gem #sqlite https://rubyonrails.ba/link/noteflakes-extralite-a-new-ruby-gem-for-working-with-sqlite-databases