@libsql/client
Advanced tools
Comparing version 0.8.1 to 0.9.0
@@ -84,6 +84,6 @@ "use strict"; | ||
let stmt; | ||
if (typeof stmtOrSql === 'string') { | ||
if (typeof stmtOrSql === "string") { | ||
stmt = { | ||
sql: stmtOrSql, | ||
args: args || [] | ||
args: args || [], | ||
}; | ||
@@ -90,0 +90,0 @@ } |
@@ -143,3 +143,7 @@ "use strict"; | ||
this.#checkNotClosed(); | ||
await this.#getDb().sync(); | ||
const rep = await this.#getDb().sync(); | ||
return { | ||
frames_synced: rep.frames_synced, | ||
frame_no: rep.frame_no, | ||
}; | ||
} | ||
@@ -146,0 +150,0 @@ close() { |
@@ -110,6 +110,6 @@ "use strict"; | ||
let stmt; | ||
if (typeof stmtOrSql === 'string') { | ||
if (typeof stmtOrSql === "string") { | ||
stmt = { | ||
sql: stmtOrSql, | ||
args: args || [] | ||
args: args || [], | ||
}; | ||
@@ -196,3 +196,3 @@ } | ||
sync() { | ||
return Promise.resolve(); | ||
throw new api_1.LibsqlError("sync not supported in ws mode", "SYNC_NOT_SUPPORTED"); | ||
} | ||
@@ -199,0 +199,0 @@ async #openStream() { |
/// <reference types="node" /> | ||
import * as hrana from "@libsql/hrana-client"; | ||
import type { Config, Client } from "@libsql/core/api"; | ||
import type { InStatement, ResultSet, Transaction, IntMode, InArgs } from "@libsql/core/api"; | ||
import type { InStatement, ResultSet, Transaction, IntMode, InArgs, Replicated } from "@libsql/core/api"; | ||
import { TransactionMode } from "@libsql/core/api"; | ||
@@ -24,3 +24,3 @@ import type { ExpandedConfig } from "@libsql/core/config"; | ||
executeMultiple(sql: string): Promise<void>; | ||
sync(): Promise<void>; | ||
sync(): Promise<Replicated>; | ||
close(): void; | ||
@@ -27,0 +27,0 @@ get closed(): boolean; |
@@ -50,6 +50,6 @@ import * as hrana from "@libsql/hrana-client"; | ||
let stmt; | ||
if (typeof stmtOrSql === 'string') { | ||
if (typeof stmtOrSql === "string") { | ||
stmt = { | ||
sql: stmtOrSql, | ||
args: args || [] | ||
args: args || [], | ||
}; | ||
@@ -56,0 +56,0 @@ } |
import Database from "libsql"; | ||
import type { Config, IntMode, Client, Transaction, TransactionMode, ResultSet, InStatement, InArgs } from "@libsql/core/api"; | ||
import type { Config, IntMode, Client, Transaction, TransactionMode, ResultSet, InStatement, InArgs, Replicated } from "@libsql/core/api"; | ||
import type { ExpandedConfig } from "@libsql/core/config"; | ||
@@ -19,3 +19,3 @@ export * from "@libsql/core/api"; | ||
executeMultiple(sql: string): Promise<void>; | ||
sync(): Promise<void>; | ||
sync(): Promise<Replicated>; | ||
close(): void; | ||
@@ -22,0 +22,0 @@ } |
@@ -121,3 +121,7 @@ import Database from "libsql"; | ||
this.#checkNotClosed(); | ||
await this.#getDb().sync(); | ||
const rep = await this.#getDb().sync(); | ||
return { | ||
frames_synced: rep.frames_synced, | ||
frame_no: rep.frame_no, | ||
}; | ||
} | ||
@@ -124,0 +128,0 @@ close() { |
/// <reference types="node" /> | ||
import * as hrana from "@libsql/hrana-client"; | ||
import type { Config, IntMode, Client, Transaction, ResultSet, InStatement, InArgs } from "@libsql/core/api"; | ||
import type { Config, IntMode, Client, Transaction, ResultSet, InStatement, InArgs, Replicated } from "@libsql/core/api"; | ||
import { TransactionMode } from "@libsql/core/api"; | ||
@@ -35,3 +35,3 @@ import type { ExpandedConfig } from "@libsql/core/config"; | ||
executeMultiple(sql: string): Promise<void>; | ||
sync(): Promise<void>; | ||
sync(): Promise<Replicated>; | ||
_closeStream(streamState: StreamState): void; | ||
@@ -38,0 +38,0 @@ close(): void; |
@@ -76,6 +76,6 @@ import * as hrana from "@libsql/hrana-client"; | ||
let stmt; | ||
if (typeof stmtOrSql === 'string') { | ||
if (typeof stmtOrSql === "string") { | ||
stmt = { | ||
sql: stmtOrSql, | ||
args: args || [] | ||
args: args || [], | ||
}; | ||
@@ -162,3 +162,3 @@ } | ||
sync() { | ||
return Promise.resolve(); | ||
throw new LibsqlError("sync not supported in ws mode", "SYNC_NOT_SUPPORTED"); | ||
} | ||
@@ -165,0 +165,0 @@ async #openStream() { |
{ | ||
"name": "@libsql/client", | ||
"version": "0.8.1", | ||
"version": "0.9.0", | ||
"keywords": [ | ||
@@ -105,6 +105,6 @@ "libsql", | ||
"dependencies": { | ||
"@libsql/core": "^0.8.1", | ||
"@libsql/core": "^0.9.0", | ||
"@libsql/hrana-client": "^0.6.2", | ||
"js-base64": "^3.7.5", | ||
"libsql": "^0.3.10", | ||
"libsql": "^0.4.1", | ||
"promise-limit": "^2.7.0" | ||
@@ -111,0 +111,0 @@ }, |
118368
2828
+ Added@libsql/core@0.9.0(transitive)
+ Added@libsql/darwin-arm64@0.4.7(transitive)
+ Added@libsql/darwin-x64@0.4.7(transitive)
+ Added@libsql/linux-arm64-gnu@0.4.7(transitive)
+ Added@libsql/linux-arm64-musl@0.4.7(transitive)
+ Added@libsql/linux-x64-gnu@0.4.7(transitive)
+ Added@libsql/linux-x64-musl@0.4.7(transitive)
+ Added@libsql/win32-x64-msvc@0.4.7(transitive)
+ Addedlibsql@0.4.7(transitive)
- Removed@libsql/core@0.8.1(transitive)
- Removed@libsql/darwin-arm64@0.3.19(transitive)
- Removed@libsql/darwin-x64@0.3.19(transitive)
- Removed@libsql/linux-arm64-gnu@0.3.19(transitive)
- Removed@libsql/linux-arm64-musl@0.3.19(transitive)
- Removed@libsql/linux-x64-gnu@0.3.19(transitive)
- Removed@libsql/linux-x64-musl@0.3.19(transitive)
- Removed@libsql/win32-x64-msvc@0.3.19(transitive)
- Removedlibsql@0.3.19(transitive)
Updated@libsql/core@^0.9.0
Updatedlibsql@^0.4.1