Skip to content

Commit bd809bf

Browse files
committed
Merge remote-tracking branch 'upstream/main' into feature/node-sqlite
2 parents 72274ae + 4028640 commit bd809bf

4 files changed

Lines changed: 26 additions & 11 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
- uses: actions/checkout@v3
1515
- uses: erlef/setup-beam@v1
1616
with:
17-
otp-version: "25.2"
18-
gleam-version: "1.4.0"
17+
otp-version: "28"
18+
gleam-version: "1.13.0"
1919
rebar3-version: "3"
2020
- uses: denoland/setup-deno@v1
2121
with:

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v1.0.3 - 2025-10-21
4+
5+
- Remove version specifier for Deno `x/sqlite` import.
6+
37
## v1.0.2 - 2025-07-01
48

59
- Updated for latest `gleam_stdlib`.
@@ -39,7 +43,7 @@
3943

4044
## v0.5.0 - 2023-01-08
4145

42-
- This library now works on JavaScript with the Deno runtime.
46+
- This library now works on JavaScript with the Deno runtime.
4347
- The `status` function has been removed.
4448

4549
## v0.4.0 - 2023-01-02

gleam.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "sqlight"
2-
version = "1.0.2"
2+
version = "1.0.3"
33
licences = ["Apache-2.0"]
44
description = "Use SQLite from Gleam!"
55

src/sqlight.gleam

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub type Error {
1919
code: ErrorCode,
2020
message: String,
2121
/// If the most recent error references a specific token in the input SQL,
22-
/// this is the byte offset of the start of that token.
22+
/// this is the byte offset of the start of that token.
2323
/// If the most recent error does not reference a specific token, this is -1.
2424
offset: Int,
2525
)
@@ -320,15 +320,15 @@ fn close_(a: Connection) -> Result(Nil, Error)
320320
/// ```gleam
321321
/// let assert Ok(conn) = open("file:data.sqlite3")
322322
/// ```
323-
///
323+
///
324324
/// ## Opens "data.db" in read only mode with a private cache
325-
///
325+
///
326326
/// ```gleam
327327
/// let assert Ok(conn) = open("file:data.db?mode=ro&cache=private")
328328
/// ```
329-
///
330-
/// Opens a shared memory database named memdb1 with a shared cache.
331-
///
329+
///
330+
/// Opens a shared memory database named memdb1 with a shared cache.
331+
///
332332
/// ```gleam
333333
/// let assert Ok(conn) = open("file:memdb1?mode=memory&cache=shared")
334334
/// ```
@@ -347,7 +347,7 @@ pub fn close(connection: Connection) -> Result(Nil, Error) {
347347
close_(connection)
348348
}
349349

350-
/// Open a connection to a SQLite database and execute a function with it,.try
350+
/// Open a connection to a SQLite database and execute a function with it, then
351351
/// close the connection.
352352
///
353353
/// This function works well with a `use` expression to automatically close the
@@ -371,10 +371,21 @@ pub fn with_connection(path: String, f: fn(Connection) -> a) -> a {
371371
value
372372
}
373373

374+
/// Execute one or more SQL statements without returning the results.
375+
///
374376
pub fn exec(sql: String, on connection: Connection) -> Result(Nil, Error) {
375377
exec_(sql, connection)
376378
}
377379

380+
/// Execute a sql statement and try to decode the result.
381+
///
382+
/// ## Running multiple queries
383+
///
384+
/// SQLite's `query` function will only run a single SQL query. If you have
385+
/// multiple queries in the string only the first one will be executed, and the
386+
/// others discarded.
387+
/// Use `exec` if you want to run run multiple queries in a single function call.
388+
///
378389
pub fn query(
379390
sql: String,
380391
on connection: Connection,

0 commit comments

Comments
 (0)