Socket
Socket
Sign inDemoInstall

libsql-stateless-easy

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libsql-stateless-easy - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

20

lib-cjs/client.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.libsqlClient = void 0;
const simple_functions_1 = require("./simple_functions");
class libsqlClient {
conf;
constructor(conf) {
checkServerOnRun;
constructor(conf, checkServerOnRun) {
this.conf = conf;
this.checkServerOnRun = checkServerOnRun;
}
execute() {
async execute(stmt) {
if (this.checkServerOnRun &&
!(await this.serverOk()))
throw Error("Server is not compatible with `libsql-stateless`");
return await (0, simple_functions_1.libsqlExecute)(this.conf, stmt);
}
batch() {
async batch(steps) {
if (this.checkServerOnRun &&
!(await this.serverOk()))
throw Error("Server is not compatible with `libsql-stateless`");
return await (0, simple_functions_1.libsqlBatch)(this.conf, steps);
}
async serverOk() {
return await (0, simple_functions_1.libsqlServerCompatCheck)(this.conf);
}
}
exports.libsqlClient = libsqlClient;

7

lib-cjs/simple_functions.js

@@ -26,3 +26,6 @@ "use strict";

exports.libsqlBatch = libsqlBatch;
var libsql_stateless_2 = require("libsql-stateless");
Object.defineProperty(exports, "libsqlServerCompatCheck", { enumerable: true, get: function () { return libsql_stateless_2.libsqlServerCompatCheck; } });
async function libsqlServerCompatCheck(conf) {
const res = await (0, libsql_stateless_1.libsqlServerCompatCheck)(conf);
return (res.isOk) ? true : false;
}
exports.libsqlServerCompatCheck = libsqlServerCompatCheck;
import { libsqlConfig } from "libsql-stateless";
import { rawSQLStatement } from "./types";
export declare class libsqlClient {
readonly conf: libsqlConfig;
constructor(conf: libsqlConfig);
execute(): void;
batch(): void;
private readonly conf;
private readonly checkServerOnRun;
constructor(conf: libsqlConfig, checkServerOnRun: boolean);
execute(stmt: rawSQLStatement): Promise<import("./types").ResultSet>;
batch(steps: Array<rawSQLStatement>): Promise<import("./types").ResultSet[]>;
serverOk(): Promise<boolean>;
}

@@ -0,10 +1,24 @@

import { libsqlBatch, libsqlExecute, libsqlServerCompatCheck } from "./simple_functions";
export class libsqlClient {
conf;
constructor(conf) {
checkServerOnRun;
constructor(conf, checkServerOnRun) {
this.conf = conf;
this.checkServerOnRun = checkServerOnRun;
}
execute() {
async execute(stmt) {
if (this.checkServerOnRun &&
!(await this.serverOk()))
throw Error("Server is not compatible with `libsql-stateless`");
return await libsqlExecute(this.conf, stmt);
}
batch() {
async batch(steps) {
if (this.checkServerOnRun &&
!(await this.serverOk()))
throw Error("Server is not compatible with `libsql-stateless`");
return await libsqlBatch(this.conf, steps);
}
async serverOk() {
return await libsqlServerCompatCheck(this.conf);
}
}

@@ -5,2 +5,2 @@ import { libsqlConfig } from "libsql-stateless";

export declare function libsqlBatch(conf: libsqlConfig, steps: Array<rawSQLStatement>): Promise<Array<ResultSet>>;
export { libsqlServerCompatCheck } from 'libsql-stateless';
export declare function libsqlServerCompatCheck(conf: libsqlConfig): Promise<boolean>;

@@ -1,2 +0,2 @@

import { libsqlExecute as LIBlibsqlExecute, libsqlBatch as LIBlibsqlBatch } from "libsql-stateless";
import { libsqlExecute as LIBlibsqlExecute, libsqlBatch as LIBlibsqlBatch, libsqlServerCompatCheck as LIBlibsqlServerCompatCheck } from "libsql-stateless";
import { SQLStatementBuilder } from "./builders";

@@ -21,2 +21,5 @@ import { libsqlBatchStreamResParser, libsqlStatementResParser } from "./parsers";

}
export { libsqlServerCompatCheck } from 'libsql-stateless';
export async function libsqlServerCompatCheck(conf) {
const res = await LIBlibsqlServerCompatCheck(conf);
return (res.isOk) ? true : false;
}
{
"name": "libsql-stateless-easy",
"version": "1.0.2",
"version": "1.0.3",
"homepage": "https://github.com/DaBigBlob/libsql-stateless-easy#readme",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc