crystal-mimer
Version, currently 0.1.02 versions
- 0.1.1latestJul 3, 2026
- 0.1.0not indexedJul 3, 2026
github.com/majorproblem/crystal-mimer
Mimer SQL database driver for Crystal
Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
crystal-mimer:
github: majorproblem/crystal-mimer
version: ~> 0.1.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
crystal-mimer
Mimer SQL database driver for Crystal, built on the crystal-db interface.
Prerequisites
- Mimer SQL installed with
libmimerapiavailable on your library path - Crystal >= 1.0.0
Installation
Add to your shard.yml:
dependencies:
mimer:
github: majorproblem/crystal-mimer
version: ~> 0.1.0
Then run:
shards install
Usage
require "mimer"
DB.open("mimer://USER:PASSWORD@/DATABASE") do |db|
# DDL
db.exec "CREATE TABLE users (id INTEGER, name NVARCHAR(100), active BOOLEAN)"
# Parameterized insert
db.exec "INSERT INTO users VALUES (?, ?, ?)", 1, "Alice", true
# Query
db.query "SELECT id, name, active FROM users" do |rs|
rs.each do
id = rs.read(Int32)
name = rs.read(String)
active = rs.read(Bool)
puts "#{id}: #{name} (active=#{active})"
end
end
# Scalar query
count = db.query_one "SELECT COUNT(*) FROM users", as: Int32
# Nullable column
name = db.query_one "SELECT name FROM users WHERE id = ?", 99, as: String?
end
Connection URI
mimer://USER:PASSWORD@/DATABASE # local database
mimer://USER:PASSWORD@SERVER/DATABASE # network connection via server alias
Transactions
Transactions use the Mimer C API (MimerBeginTransaction / MimerEndTransaction) rather than SQL statements:
DB.open("mimer://USER:PASSWORD@/DATABASE") do |db|
db.transaction do |tx|
tx.connection.exec "INSERT INTO users VALUES (?, ?, ?)", 2, "Bob", false
# raises → automatic rollback
end
end
Supported types
| Crystal type | Mimer SQL type |
|---|---|
Int32 | INTEGER |
Int64 | BIGINT |
Float64 | DOUBLE PRECISION, FLOAT |
String | NVARCHAR, VARCHAR, CHAR |
Bool | BOOLEAN |
Nil / nilable | NULL |
Running the tests
Tests require a live Mimer SQL instance and a writable databank:
MIMER_DATABASE=testdb MIMER_USER=SYSADM MIMER_PASSWORD=SYSADM crystal spec
License
MIT — see LICENSE.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Jul 3, 2026
- Commit
bf0da9e3f7a6- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/majorproblem/crystal-mimer
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 2