mirror of
https://github.com/stablyai/orca.git
synced 2026-10-09 08:02:35 +00:00
Bundle a pinned, verified Bun runtime for headless Orca so existing Node launch commands can hand off before opening a profile. Keep desktop execution on Electron. Add the Bun SQLite adapter and terminal backend, bounded shutdown, process inspection and cross-platform artifact qualification. Keep future managed SSH deployment separate from current production launch paths.
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import type { StatementResultingChanges } from 'node:sqlite'
|
|
import { SqliteIntegerReader } from './sqlite-integer-reader'
|
|
import type { SqliteBindings, SqliteRow, SqliteStatement } from './sqlite-statement'
|
|
|
|
export class NodeSqliteStatement implements SqliteStatement {
|
|
private readonly integers = new SqliteIntegerReader()
|
|
|
|
constructor(private readonly statement: SqliteStatement) {
|
|
// Native number reads overflow their INT64_MIN guard on some builds and round insert rowids.
|
|
statement.setReadBigInts(true)
|
|
}
|
|
|
|
all(...parameters: SqliteBindings): SqliteRow[] {
|
|
const rows = this.statement.all(...parameters)
|
|
for (const row of rows) {
|
|
this.integers.row(row)
|
|
}
|
|
return rows
|
|
}
|
|
|
|
get(...parameters: SqliteBindings): SqliteRow | undefined {
|
|
const row = this.statement.get(...parameters)
|
|
return row === undefined ? undefined : this.integers.row(row)
|
|
}
|
|
|
|
run(...parameters: SqliteBindings): StatementResultingChanges {
|
|
return this.integers.result(this.statement.run(...parameters))
|
|
}
|
|
|
|
*iterate(...parameters: SqliteBindings): IterableIterator<SqliteRow> {
|
|
for (const row of this.statement.iterate(...parameters)) {
|
|
yield this.integers.row(row)
|
|
}
|
|
}
|
|
|
|
setReadBigInts(enabled: boolean): void {
|
|
this.integers.readBigInts = enabled
|
|
}
|
|
}
|