Repository navigation
Releases
v1.0.0 ✦ SELECT SQL AS "À la Arturo";
SELECT SQL AS "À la Arturo";
The first stable release of SQL, À la Arturo.
Build queries with expression.
~ CODE IS ART. SQL can be, too. ~
Built with Arturo 0.10.0 "Bark", this release introduces an expressive SQL domain-specific language (DSL) that brings SQL closer to Arturo's natural syntax.
Write queries as Arturo expressions, compile them into SQL, and keep your statements separate from their bound parameters.
SELECT * FROM features;
- Expressive DSL · Build SQL statements using native Arturo blocks, without manually concatenating SQL strings.
- Query composition · Filters, joins, aggregates, subqueries, CTEs, and set operations.
- Data manipulation · Insert, update, and delete records.
- Schema definitions · Create tables, views, and triggers.
- Two SQL dialects · Compile for SQLite or PostgreSQL.
- Bound parameters · Capture Arturo variables using
@variablereferences. - SQLite execution · Execute queries directly through Arturo's SQLite integration.
- Command-line interface · Query databases or compile statements from your terminal.
- Cross-platform · Tested on Linux, macOS, FreeBSD, and Windows.
SELECT * FROM quick_start;
Install the package:
arturo -p install sqlBuild your first query:
import {sql}!
minimumAge: 18
statement: sql [
from :users
select [id name]
where [age >= @minimumAge]
order 'name
limit 20
]
compiled: to :sqliteQuery statement
print compiled\text
inspect compiled\params
The same statement can target PostgreSQL:
compiled: to :postgresQuery statement
One DSL. Multiple dialects.
SELECT * FROM cli;
The package includes a CLI for executing SQLite queries and compiling SQL statements.
# Execute a SQLite query
sql query books.db 'from :books select title'
# Return JSON
sql query books.db 'from :books select title' -o json
# Read a statement from a file
sql query books.db --file examples/query.art
# Compile for PostgreSQL
sql compile 'from :books select title' -d postgresRun sql --help to explore the available commands.
SELECT * FROM compatibility;
| Component | Support |
|---|---|
| Arturo | 0.10.0 "Bark" or newer |
| SQLite | Compilation + execution |
| PostgreSQL | Compilation |
| Linux | ✓ |
| macOS | ✓ |
| FreeBSD | ✓ |
| Windows | ✓ |
Note: PostgreSQL execution requires an external driver. The package generates SQL text and bound parameters without establishing a connection.
SELECT * FROM future;
· Version 1.0.0 establishes the foundation for further development.
· Future releases will focus on expanding SQL coverage, improving dialect compatibility, and refining the developer experience.
✦ FROM Arturo, WITH expression;
Build queries with expression.
· Documentation
· Examples
· Roadmap
· Full Changelog
MIT Licensed · Arturo 0.10 "Bark" · v1.0.0
