• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rogerpadilla / uql / 20685289522

04 Jan 2026 12:49AM UTC coverage: 95.658% (-0.1%) from 95.778%
20685289522

push

github

rogerpadilla
chore(release): publish

 - @uql/core@3.6.0

1303 of 1434 branches covered (90.86%)

Branch coverage included in aggregate %.

3434 of 3518 relevant lines covered (97.61%)

234.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.79
/packages/core/src/libsql/libsqlQuerier.ts
1
import type { Client, InValue, Transaction } from '@libsql/client';
2
import { Serialized } from '../querier/decorator/index.js';
3
import { AbstractSqliteQuerier } from '../sqlite/abstractSqliteQuerier.js';
4
import { SqliteDialect } from '../sqlite/index.js';
5
import type { ExtraOptions } from '../type/index.js';
6

7
export class LibsqlQuerier extends AbstractSqliteQuerier {
8
  private tx?: Transaction;
9

10
  constructor(
11
    readonly client: Client,
12
    override readonly extra?: ExtraOptions,
13
  ) {
14
    super(new SqliteDialect(extra?.namingStrategy), extra);
6✔
15
  }
16

17
  override async internalAll<T>(query: string, values?: unknown[]) {
18
    const target = this.tx || this.client;
2✔
19
    const res = await target.execute({ sql: query, args: values as InValue[] });
2✔
20
    return res.rows as T[];
2✔
21
  }
22

23
  override async internalRun(query: string, values?: unknown[]) {
24
    const target = this.tx || this.client;
1✔
25
    const res = await target.execute({ sql: query, args: values as InValue[] });
1✔
26
    return this.buildUpdateResult(res.rowsAffected, res.lastInsertRowid);
1✔
27
  }
28

29
  override get hasOpenTransaction() {
30
    return !!this.tx;
3✔
31
  }
32

33
  @Serialized()
34
  override async beginTransaction() {
35
    if (this.tx) {
3!
36
      throw TypeError('pending transaction');
×
37
    }
38
    this.tx = await this.client.transaction('write');
3✔
39
  }
40

41
  @Serialized()
42
  override async commitTransaction() {
43
    if (!this.tx) {
1!
44
      throw TypeError('not a pending transaction');
×
45
    }
46
    await this.tx.commit();
1✔
47
    this.tx = undefined;
1✔
48
  }
49

50
  @Serialized()
51
  override async rollbackTransaction() {
52
    if (!this.tx) {
1!
53
      throw TypeError('not a pending transaction');
×
54
    }
55
    await this.tx.rollback();
1✔
56
    this.tx = undefined;
1✔
57
  }
58

59
  override async internalRelease() {
60
    if (this.tx) {
1!
61
      this.tx.close();
1✔
62
    }
63
  }
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc