All Projects → crystal-lang → crystal-sqlite3

crystal-lang / crystal-sqlite3

Licence: MIT license
SQLite3 bindings for Crystal

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to crystal-sqlite3

sqlite3
The fastest and correct module for SQLite3 in Deno.
Stars: ✭ 143 (+21.19%)
Mutual labels:  driver, sqlite3
embedded-sps
Embedded i2c Driver for Sensirion Particulate Matter Sensors - Download the Zip Package from the Release Page
Stars: ✭ 36 (-69.49%)
Mutual labels:  driver
fdb
Firebird Driver for Python
Stars: ✭ 49 (-58.47%)
Mutual labels:  driver
sqlite-spellfix
Loadable spellfix1 extension for sqlite as python package
Stars: ✭ 13 (-88.98%)
Mutual labels:  sqlite3
Mathurat
A text-based Mathurat library
Stars: ✭ 14 (-88.14%)
Mutual labels:  sqlite3
wfx-fullMAC-driver
Silicon Laboratories WFx Wi-Fi Full-MAC driver
Stars: ✭ 14 (-88.14%)
Mutual labels:  driver
w1-gpio-cl
Command line configured kernel mode 1-wire bus master driver. w1-gpio standard Linux module enhancement/substitution.
Stars: ✭ 17 (-85.59%)
Mutual labels:  driver
hwidspoofer
HardwareID Spoofer using kernelmode
Stars: ✭ 68 (-42.37%)
Mutual labels:  driver
nim-gatabase
Connection-Pooling Compile-Time ORM for Nim
Stars: ✭ 103 (-12.71%)
Mutual labels:  sqlite3
spinnaker sdk camera driver
Point Grey (FLIR) Spinnaker based camera driver (Blackfly S etc.)
Stars: ✭ 106 (-10.17%)
Mutual labels:  driver
hUGEDriver
An easy-to-use, fast, tracker-based, public domain sound driver for Game Boy homebrew
Stars: ✭ 26 (-77.97%)
Mutual labels:  driver
Online-News-Portal-with-Django
Daily News For You is an online news portal developed by Django and SQLite
Stars: ✭ 45 (-61.86%)
Mutual labels:  sqlite3
LoginToASqlite3DatabaseWithoutCredentialsWithAdminer
✔️ An Adminer plugin to use SQLite databases without credentials (no username and no password)
Stars: ✭ 30 (-74.58%)
Mutual labels:  sqlite3
dotnet-arangodb
.NET Driver for ArangoDB
Stars: ✭ 52 (-55.93%)
Mutual labels:  driver
network performance monitor
Network Performance Monitor - a portable tool for troubleshooting performance issues with home networks
Stars: ✭ 74 (-37.29%)
Mutual labels:  sqlite3
hid-tmff2
Linux kernel module for Thrustmaster T300RS and T248
Stars: ✭ 83 (-29.66%)
Mutual labels:  driver
ars 40X
Driver for the Continental radar ARS_404 / ARS_408.
Stars: ✭ 55 (-53.39%)
Mutual labels:  driver
veikk-linux-driver
Linux driver for VEIKK-brand digitizers
Stars: ✭ 130 (+10.17%)
Mutual labels:  driver
docker-sqlite3
Sqlite3 command line in a docker container
Stars: ✭ 28 (-76.27%)
Mutual labels:  sqlite3
ant-arduino
An implementation of a ANT driver for Arduino, Mbed and ESP-IDF
Stars: ✭ 69 (-41.53%)
Mutual labels:  driver

crystal-sqlite3 Build Status

SQLite3 bindings for Crystal.

Check crystal-db for general db driver documentation. crystal-sqlite3 driver is registered under sqlite3:// uri.

Installation

Add this to your application's shard.yml:

dependencies:
  sqlite3:
    github: crystal-lang/crystal-sqlite3

Usage

require "sqlite3"

DB.open "sqlite3://./data.db" do |db|
  db.exec "create table contacts (name text, age integer)"
  db.exec "insert into contacts values (?, ?)", "John Doe", 30

  args = [] of DB::Any
  args << "Sarah"
  args << 33
  db.exec "insert into contacts values (?, ?)", args: args

  puts "max age:"
  puts db.scalar "select max(age) from contacts" # => 33

  puts "contacts:"
  db.query "select name, age from contacts order by age desc" do |rs|
    puts "#{rs.column_name(0)} (#{rs.column_name(1)})"
    # => name (age)
    rs.each do
      puts "#{rs.read(String)} (#{rs.read(Int32)})"
      # => Sarah (33)
      # => John Doe (30)
    end
  end
end

DB::Any

  • Time is implemented as TEXT column using SQLite3::DATE_FORMAT_SUBSECOND format (or SQLite3::DATE_FORMAT_SECOND if the text does not contain a dot).
  • Bool is implemented as INT column mapping 0/1 values.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].