Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

libsql-stateless-easy

Package Overview
Dependencies
Maintainers
0
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.7.0 to 1.7.1

21

dist/main.d.ts

@@ -172,3 +172,3 @@ import { libsqlSQLValue, libsqlSQLStatement, libsqlBatchReqStepExecCond, libsqlBatchReqStep, libsqlStatementResOkData, libsqlBatchStreamResOkData, libsqlStreamResErrData } from 'libsql-stateless';

};
declare function libsqlBatchReqStepsBuilder(batch_queries: Array<rawSQLStatement>, batch_conditions: Array<libsqlBatchReqStepExecCond | undefined | null>): Array<libsqlBatchReqStep>;
declare function libsqlBatchReqStepsBuilder(batch_queries: Array<rawSQL | rawSQLStatement>, batch_conditions: Array<libsqlBatchReqStepExecCond | undefined | null>): Array<libsqlBatchReqStep>;
declare function libsqlTransactionBeginStatement(mode: TransactionMode): libsqlBatchReqStep;

@@ -184,3 +184,3 @@ declare function libsqlTransactionEndStatements(last_step_before_this: number): Array<libsqlBatchReqStep>;

declare function libsqlExecute(conf: libsqlConfig, stmt_or_sql: rawSQL | rawSQLStatement, or_args?: rawSQLArgs, or_want_rows?: boolean): Promise<ResultSet>;
declare function libsqlBatch(conf: libsqlConfig, steps: Array<rawSQLStatement>, step_conditions: Array<libsqlBatchReqStepExecCond | null | undefined>): Promise<Array<ResultSet | null>>;
declare function libsqlBatch(conf: libsqlConfig, steps: Array<rawSQL | rawSQLStatement>, step_conditions: Array<libsqlBatchReqStepExecCond | null | undefined>): Promise<Array<ResultSet | null>>;
declare function libsqlServerCompatCheck(conf: libsqlConfig): Promise<boolean>;

@@ -212,11 +212,11 @@ declare function libsqlBatchTransaction(conf: libsqlConfig, steps: Array<rawSQL | rawSQLStatement>, mode?: TransactionMode): Promise<Array<ResultSet>>;

* // execute a statement with positional arguments
* const rs = await client.execute({
* const rs = await client.execute(
* "SELECT * FROM books WHERE author = ?",
* ["Jane Austen"],
* });
* );
* // for backward compatibality
* const rs = await client.execute(
* const rs = await client.execute({
* sql: "SELECT * FROM books WHERE author = ?",
* args: ["Jane Austen"],
* );
* });
*

@@ -239,2 +239,4 @@ * // execute a statement with named arguments

*
* NOTE: For batch SQL statement execution without transaction, use {@link batchWithoutTransaction}.
*
* The batch is executed in its own logical database connection and the statements are wrapped in a

@@ -271,2 +273,9 @@ * transaction. This ensures that the batch is applied atomically: either all or no changes are applied.

batch(steps: Array<rawSQL | rawSQLStatement>, mode?: TransactionMode): Promise<ResultSet[]>;
/** Execute a batch of SQL statements.
*
* The same as {@link batch} but the SQL statements are not executed in a transaction.
*
* The `step_conditions` is an array of step conditions generated using {@link libsqlBatchReqStepExecCondBuilder}.
*/
batchWithoutTransaction(steps: Array<rawSQL | rawSQLStatement>, step_conditions: Array<libsqlBatchReqStepExecCond | null | undefined>): Promise<(ResultSet | null)[]>;
transaction(mode?: TransactionMode): Promise<any>;

@@ -273,0 +282,0 @@ /** Execute a sequence of SQL statements separated by semicolons.

import { libsqlExecute, libsqlBatch, libsqlServerCompatCheck } from 'libsql-stateless';
var rt=Object.defineProperty;var st=(t,e,s)=>e in t?rt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var l=(t,e,s)=>st(t,typeof e!="symbol"?e+"":e,s);var m=typeof Buffer=="function",L=typeof btoa=="function",C=typeof atob=="function",Q=t=>atob(t),O=t=>btoa(t),U=t=>Buffer.from(t).toString("base64"),T=t=>Buffer.from(t,"binary").toString("base64"),k=t=>Buffer.from(t,"base64"),I=t=>Buffer.from(t,"base64").toString("binary");var nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=Array.prototype.slice.call(nt),h=(t=>{let e={};return t.forEach((s,r)=>e[s]=r),e})(d),ot=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,at=t=>{let e,s,r,n,o="",i=t.length%3;for(let u=0;u<t.length;){if((s=t.charCodeAt(u++))>255||(r=t.charCodeAt(u++))>255||(n=t.charCodeAt(u++))>255)throw new TypeError("invalid character found");e=s<<16|r<<8|n,o+=d[e>>18&63]+d[e>>12&63]+d[e>>6&63]+d[e&63];}return i?o.slice(0,i-3)+"===".substring(i):o},it=L?t=>O(t):m?t=>T(t):at,lt=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),M=m?t=>U(t):t=>{let s=[];for(let r=0,n=t.length;r<n;r+=4096){let o=[];t.subarray(r,r+4096).forEach(i=>o.push(i.valueOf())),s.push(S.apply(null,o));}return it(s.join(""))},S=String.fromCharCode.bind(String),P=(t,e=!1)=>e?lt(M(t)):M(t),N=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),ct=t=>{if(t=t.replace(/\s+/g,""),!ot.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,s="",r,n;for(let o=0;o<t.length;)e=h[t.charAt(o++)]<<18|h[t.charAt(o++)]<<12|(r=h[t.charAt(o++)])<<6|(n=h[t.charAt(o++)]),s+=r===64?S(e>>16&255):n===64?S(e>>16&255,e>>8&255):S(e>>16&255,e>>8&255,e&255);return s},ut=C?t=>Q(N(t)):m?t=>I(t):ct,v=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),pt=m?t=>v(k(t)):t=>v(ut(t).split("").map(e=>e.charCodeAt(0))),ft=t=>N(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),V=t=>pt(ft(t));var a=class extends Error{constructor(s,r,n){super(`${r}: ${s}`,{cause:n});l(this,"code");l(this,"rawCode");this.code=r,this.rawCode=void 0,this.name="LibsqlError";}},q=class extends a{constructor(e){super(e,"HRANA_PROTO_ERROR",new class extends Error{constructor(){super(e),this.name="ProtoError";}});}},c=class extends a{constructor(e,s){super(e,s.code||"UNKNOWN",new class extends Error{constructor(){super(e);l(this,"proto");this.name="ResponseError",this.proto=s,this.stack=void 0;}});}},p=class extends a{constructor(e,s){super(e,"SERVER_ERROR",new class extends Error{constructor(){super(e);l(this,"status");this.status=s,this.name="HttpServerError";}});}},f=class extends a{constructor(e){super(e,"INTERNAL_ERROR",new class extends Error{constructor(){super(e),this.name="InternalError";}});}},w=class extends a{constructor(e){super(e,"UNKNOWN",new class extends Error{constructor(){super(e),this.name="MisuseError";}});}};function D(t){if(t===null)return {type:"null"};if(typeof t=="bigint")return {type:"integer",value:""+t};if(typeof t=="number")return {type:"float",value:t};if(typeof t=="string")return {type:"text",value:t};if(t instanceof Uint8Array)return {type:"blob",base64:P(t)};throw new f("Invalid type of input. Cannot build request to server.")}function j(t){if(t===void 0)return {};if(Object.prototype.toString.call(t)==="[object Array]")return {args:t.map(e=>D(e))};{let e=[],s=t;for(let r in s)e.push({name:r,value:D(s[r])});return {named_args:e}}}function y(t,e,s){if(typeof t=="string"){let r=j(e);return {sql:t,args:r.args,named_args:r.named_args,want_rows:s}}else {let r=j(t.args);return {sql:t.sql,args:r.args,named_args:r.named_args,want_rows:t.want_rows}}}var g={ok:t=>({type:"ok",step:t}),error:t=>({type:"error",step:t}),not:t=>({type:"not",cond:t}),and:t=>({type:"and",conds:t}),or:t=>({type:"or",conds:t}),is_autocommit:()=>({type:"is_autocommit"})};function H(t,e){return t.map((s,r)=>({stmt:y(s),condition:e[r]||void 0}))}function mt(t){if(t==="write")return {stmt:{sql:"BEGIN IMMEDIATE"}};if(t==="read")return {stmt:{sql:"BEGIN TRANSACTION READONLY"}};if(t==="deferred")return {stmt:{sql:"BEGIN DEFERRED"}};throw RangeError('Unknown transaction mode, supported values are "write", "read" and "deferred"')}function dt(t){return [{stmt:{sql:"COMMIT"},condition:{type:"ok",step:t}},{stmt:{sql:"ROLLBACK"},condition:{type:"not",cond:{type:"ok",step:t+1}}}]}function W(t,e){let s=t.map((r,n)=>({stmt:y(r),condition:g.ok(n)}));return [mt(e)].concat(s).concat(dt(s.length))}function bt(t,e="number"){switch(e){case"number":return +t;case"string":return t;case"bigint":return BigInt(t);default:throw new w('Invalid value for "intMode".')}}function ht(t,e){switch(t.type){case"null":return null;case"integer":return bt(t.value,e);case"float":return Number(t.value);case"text":return t.value;case"blob":return V(t.base64);default:throw new q("Invalid data type from server. Cannot parse.")}}function _(t,e){let s=[];for(let n=0;n<t.rows.length;n++){let o={};Object.defineProperty(o,"length",{value:t.rows[n].length});for(let i=0;i<t.rows[n].length;i++){let u=ht(t.rows[n][i],e);Object.defineProperty(o,i,{value:u});let R=t.cols[i].name;R!==void 0&&!Object.hasOwn(o,R)&&Object.defineProperty(o,R,{value:u,enumerable:!0,configurable:!0,writable:!0});}s.push(o);}let r={rows:s,columns:t.cols.map(n=>n.name||""),columnTypes:t.cols.map(n=>n.decltype||""),rowsAffected:t.affected_row_count,lastInsertRowid:t.last_insert_rowid?BigInt(t.last_insert_rowid):void 0,rowsRead:t.rows_read,rowsWritten:t.rows_written,queryDurationMS:t.query_duration_ms};return {...r,toJSON:()=>r}}function x(t,e){return t.step_results.map((s,r)=>{var n;if(s)return _(s,e);if(t.step_errors[r])throw new c(((n=t.step_errors[r])==null?void 0:n.message)||"",t.step_errors[r]);return null})}function z(t,e){let s=x(t,e);return s.slice(1,s.length-2).filter(r=>r!==null)}function b(t){return {db_url:t.url,authToken:t.authToken,fetch:t.fetch}}async function F(t,e,s,r){let n=await libsqlExecute(b(t),y(e,s,r));if(n.isOk)return _(n.val,t.intMode);throw n.err.kind==="LIBSQL_SERVER_ERROR"?new p(n.err.server_message||"Server encountered error.",n.err.http_status_code):new c(n.err.data.message,n.err.data)}async function Vt(t,e,s){let r=await libsqlBatch(b(t),H(e,s));if(r.isOk)return x(r.val,t.intMode);throw r.err.kind==="LIBSQL_SERVER_ERROR"?new p(r.err.server_message||"Server encountered error.",r.err.http_status_code):new c(r.err.data.message,r.err.data)}async function K(t){return !!(await libsqlServerCompatCheck(b(t))).isOk}async function Z(t,e,s="deferred"){let r=await libsqlBatch(b(t),W(e,s));if(r.isOk)return z(r.val,t.intMode);throw r.err.kind==="LIBSQL_SERVER_ERROR"?new p(r.err.server_message||"Server encountered error.",r.err.http_status_code):new c(r.err.data.message,r.err.data)}async function G(t,e){let s=e.split(";").filter(n=>n.trim()!=="").map((n,o)=>({stmt:{sql:n},condition:g.ok(o-1)}));s[0].condition=void 0;let r=await libsqlBatch(b(t),s);if(!r.isOk)throw r.err.kind==="LIBSQL_SERVER_ERROR"?new p(r.err.server_message||"Server encountered error.",r.err.http_status_code):new c(r.err.data.message,r.err.data)}var J=typeof console.error=="function",$=typeof URL=="function",Y=t=>console.error(t),X=t=>new URL(t);function tt(t){try{if(!K(t))throw new a("Server incompatible. Please upgrade your libSQL server.","OUT_OF_DATE_SERVER")}catch{throw new a("The fetch function is non functional.","FETCH_FUCKED")}}function E(t){J&&Y(t);}function et(t){if((()=>{if($)try{let s=X(t);return !(s.protocol==="https:"||s.protocol==="http:")}catch(s){throw new a(s.message,"ERR_INVALID_URL",s)}else if(t.startsWith("https://")||t.startsWith("http://"))return !1;return !0})())throw new a('This is a HTTP client and only supports "https:" and "http:" URLs.',"URL_SCHEME_NOT_SUPPORTED")}function Jt(t){return new A(t)}var A=class{constructor(e){l(this,"conf");l(this,"closed");l(this,"protocol");e.disableCriticalChecks||(et(e.url),tt(e)),this.conf=e,this.closed=!1,this.protocol="http";}async execute(e,s,r){return await F(this.conf,e,s,r)}async batch(e,s){return await Z(this.conf,e,s)}async transaction(e){throw new f("'libsql-stateless' is stateless and does not support interactive transactions. Use this.batch() instead.")}async executeMultiple(e){return await G(this.conf,e)}async sync(){E("'libsql-stateless' is remote only so nothing to sync.");}close(){E("'libsql-stateless' is stateless therefore no connection to close.");}};
var nt=Object.defineProperty;var ot=(t,r,e)=>r in t?nt(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e;var l=(t,r,e)=>(ot(t,typeof r!="symbol"?r+"":r,e),e);var a=class extends Error{constructor(e,s,n){super(`${s}: ${e}`,{cause:n});l(this,"code");l(this,"rawCode");this.code=s,this.rawCode=void 0,this.name="LibsqlError";}},h=class extends a{constructor(r){super(r,"HRANA_PROTO_ERROR",new class extends Error{constructor(){super(r),this.name="ProtoError";}});}},u=class extends a{constructor(r,e){super(r,e.code??"UNKNOWN",new class extends Error{constructor(){super(r);l(this,"proto");this.name="ResponseError",this.proto=e,this.stack=void 0;}});}},q=class extends a{constructor(r,e){super(r,"SERVER_ERROR",new class extends Error{constructor(){super(r);l(this,"status");this.status=e,this.name="HttpServerError";}});}},p=class extends a{constructor(r){super(r,"INTERNAL_ERROR",new class extends Error{constructor(){super(r),this.name="InternalError";}});}},S=class extends a{constructor(r){super(r,"UNKNOWN",new class extends Error{constructor(){super(r),this.name="MisuseError";}});}};var f=class extends a{constructor(r,e){super(r,e,new class extends Error{constructor(){super(r),this.name="Base64Error";}});}};var b=typeof Buffer=="function",Q=typeof btoa=="function",O=typeof atob=="function",T=t=>atob(t),I=t=>btoa(t),U=t=>Buffer.from(t).toString("base64"),k=t=>Buffer.from(t,"binary").toString("base64"),M=t=>Buffer.from(t,"base64"),P=t=>Buffer.from(t,"base64").toString("binary");var at="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=Array.prototype.slice.call(at),y=(t=>{let r={};return t.forEach((e,s)=>r[e]=s),r})(m),it=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,lt=t=>{let r,e,s,n,o="",i=t.length%3;for(let c=0;c<t.length;){if((e=t.charCodeAt(c++))>255||(s=t.charCodeAt(c++))>255||(n=t.charCodeAt(c++))>255)throw new f("Invalid character found while polyfilling btoa","BTOA_POLYFILL_INVALID_CHAR");r=e<<16|s<<8|n,o+=m[r>>18&63]+m[r>>12&63]+m[r>>6&63]+m[r&63];}return i?o.slice(0,i-3)+"===".substring(i):o},ct=Q?t=>I(t):b?t=>k(t):lt,w=String.fromCharCode.bind(String),v=b?t=>U(t):t=>{let e=[];for(let s=0,n=t.length;s<n;s+=4096){let o=[];t.subarray(s,s+4096).forEach(i=>o.push(i.valueOf())),e.push(w.apply(null,o));}return ct(e.join(""))},D=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),ut=t=>{if(t=t.replace(/\s+/g,""),!it.test(t))throw new f("Malformed base64 while polyfilling atob","ATOB_POLYFILL_INVALID_CHAR");t+="==".slice(2-(t.length&3));let r,e="",s,n;for(let o=0;o<t.length;)r=y[t.charAt(o++)]<<18|y[t.charAt(o++)]<<12|(s=y[t.charAt(o++)])<<6|(n=y[t.charAt(o++)]),e+=s===64?w(r>>16&255):n===64?w(r>>16&255,r>>8&255):w(r>>16&255,r>>8&255,r&255);return e},pt=O?t=>T(D(t)):b?t=>P(t):ut,N=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),ft=b?t=>N(M(t)):t=>N(pt(t).split("").map(r=>r.charCodeAt(0))),bt=t=>D(t.replace(/[-_]/g,r=>r=="-"?"+":"/")),V=t=>ft(bt(t));function j(t){if(t===null)return {type:"null"};if(typeof t=="bigint")return {type:"integer",value:""+t};if(typeof t=="number")return {type:"float",value:t};if(typeof t=="string")return {type:"text",value:t};if(t instanceof Uint8Array)return {type:"blob",base64:v(t)};throw new p("Invalid type of input. Cannot build request to server.")}function H(t){if(t===void 0)return {};if(Object.prototype.toString.call(t)==="[object Array]")return {args:t.map(r=>j(r))};{let r=[],e=t;for(let s in e)r.push({name:s,value:j(e[s])});return {named_args:r}}}function g(t,r,e){if(typeof t=="string"){let s=H(r);return {sql:t,args:s.args,named_args:s.named_args,want_rows:e}}else {let s=H(t.args);return {sql:t.sql,args:s.args,named_args:s.named_args,want_rows:t.want_rows}}}var _={ok:t=>({type:"ok",step:t}),error:t=>({type:"error",step:t}),not:t=>({type:"not",cond:t}),and:t=>({type:"and",conds:t}),or:t=>({type:"or",conds:t}),is_autocommit:()=>({type:"is_autocommit"})};function F(t,r){return t.map((e,s)=>({stmt:g(e),condition:r[s]??void 0}))}function mt(t){if(t==="write")return {stmt:{sql:"BEGIN IMMEDIATE"}};if(t==="read")return {stmt:{sql:"BEGIN TRANSACTION READONLY"}};if(t==="deferred")return {stmt:{sql:"BEGIN DEFERRED"}};throw RangeError('Unknown transaction mode, supported values are "write", "read" and "deferred"')}function dt(t){return [{stmt:{sql:"COMMIT"},condition:{type:"ok",step:t}},{stmt:{sql:"ROLLBACK"},condition:{type:"not",cond:{type:"ok",step:t+1}}}]}function W(t,r){let e=t.map((s,n)=>({stmt:g(s),condition:_.ok(n)}));return [mt(r)].concat(e).concat(dt(e.length))}function ht(t,r="number"){switch(r){case"number":return +t;case"string":return t;case"bigint":return BigInt(t);default:throw new S('Invalid value for "intMode".')}}function qt(t,r){switch(t.type){case"null":return null;case"integer":return ht(t.value,r);case"float":return Number(t.value);case"text":return t.value;case"blob":return V(t.base64);default:throw new h("Invalid data type from server. Cannot parse.")}}function B(t,r){let e=[];for(let n=0;n<t.rows.length;n++){let o={};Object.defineProperty(o,"length",{value:t.rows[n].length});for(let i=0;i<t.rows[n].length;i++){let c=qt(t.rows[n][i],r);Object.defineProperty(o,i,{value:c});let x=t.cols[i].name;x!==void 0&&!Object.hasOwn(o,x)&&Object.defineProperty(o,x,{value:c,enumerable:!0,configurable:!0,writable:!0});}e.push(o);}let s={rows:e,columns:t.cols.map(n=>n.name??""),columnTypes:t.cols.map(n=>n.decltype??""),rowsAffected:t.affected_row_count,lastInsertRowid:t.last_insert_rowid?BigInt(t.last_insert_rowid):void 0,rowsRead:t.rows_read,rowsWritten:t.rows_written,queryDurationMS:t.query_duration_ms};return {...s,toJSON:()=>s}}function A(t,r){return t.step_results.map((e,s)=>{var n;if(e)return B(e,r);if(t.step_errors[s])throw new u(((n=t.step_errors[s])==null?void 0:n.message)??"No error message supplied by server.",t.step_errors[s]);return null})}function z(t,r){let e=A(t,r);return e.slice(1,e.length-2).filter(s=>s!==null)}function d(t){return {db_url:t.url,authToken:t.authToken,fetch:t.fetch}}function R(t){return t.kind==="LIBSQL_SERVER_ERROR"?new q(t.server_message??"No error message from server.",t.http_status_code):new u(t.data.message,t.data)}async function K(t,r,e,s){let n=await libsqlExecute(d(t),g(r,e,s));if(n.isOk)return B(n.val,t.intMode);throw R(n.err)}async function Z(t,r,e){let s=await libsqlBatch(d(t),F(r,e));if(s.isOk)return A(s.val,t.intMode);throw R(s.err)}async function G(t){return (await libsqlServerCompatCheck(d(t))).isOk}async function Y(t,r,e="deferred"){let s=await libsqlBatch(d(t),W(r,e));if(s.isOk)return z(s.val,t.intMode);throw R(s.err)}async function J(t,r){let e=r.split(";").filter(n=>n.trim()!=="").map((n,o)=>({stmt:{sql:n},condition:_.ok(o-1)}));e[0].condition=void 0;let s=await libsqlBatch(d(t),e);if(!s.isOk)throw R(s.err)}var $=typeof console.error=="function",X=typeof URL=="function",tt=t=>console.error(t),rt=t=>new URL(t);function et(t){try{if(!G(t))throw new a("Server incompatible. Please upgrade your libSQL server.","OUT_OF_DATE_SERVER")}catch{throw new a("The fetch function is non functional.","FETCH_FUCKED")}}function L(t){$&&tt(t);}function st(t){if((()=>{if(X)try{let e=rt(t);return !(e.protocol==="https:"||e.protocol==="http:")}catch(e){throw new a(e.message,"ERR_INVALID_URL",e)}else if(t.startsWith("https://")||t.startsWith("http://"))return !1;return !0})())throw new a('This is a HTTP client and only supports "https:" and "http:" URLs.',"URL_SCHEME_NOT_SUPPORTED")}function tr(t){return new C(t)}var C=class{constructor(r){l(this,"conf");l(this,"closed");l(this,"protocol");r.disableCriticalChecks||(st(r.url),et(r)),this.conf=r,this.closed=!1,this.protocol="http";}async execute(r,e,s){return await K(this.conf,r,e,s)}async batch(r,e){return await Y(this.conf,r,e)}async batchWithoutTransaction(r,e){return await Z(this.conf,r,e)}async transaction(r){throw new p("'libsql-stateless' is stateless and does not support interactive transactions. Use this.batch() instead.")}async executeMultiple(r){return await J(this.conf,r)}async sync(){L("'libsql-stateless' is remote only so nothing to sync.");}close(){L("'libsql-stateless' is stateless therefore no connection to close.");}};
export { p as HttpServerError, f as InternalError, a as LibsqlError, w as MisuseError, q as ProtoError, c as ResponseError, Jt as createClient, j as libsqlArgumentsBuilder, Vt as libsqlBatch, g as libsqlBatchReqStepExecCondBuilder, H as libsqlBatchReqStepsBuilder, x as libsqlBatchStreamResParser, Z as libsqlBatchTransaction, A as libsqlClient, F as libsqlExecute, G as libsqlExecuteMultiple, K as libsqlServerCompatCheck, y as libsqlStatementBuilder, _ as libsqlStatementResParser, W as libsqlTransactionBatchReqStepsBuilder, z as libsqlTransactionBatchStreamResParser, mt as libsqlTransactionBeginStatement, dt as libsqlTransactionEndStatements, D as libsqlValueBuilder, ht as libsqlValueParser };
export { q as HttpServerError, p as InternalError, a as LibsqlError, S as MisuseError, h as ProtoError, u as ResponseError, tr as createClient, H as libsqlArgumentsBuilder, Z as libsqlBatch, _ as libsqlBatchReqStepExecCondBuilder, F as libsqlBatchReqStepsBuilder, A as libsqlBatchStreamResParser, Y as libsqlBatchTransaction, C as libsqlClient, K as libsqlExecute, J as libsqlExecuteMultiple, G as libsqlServerCompatCheck, g as libsqlStatementBuilder, B as libsqlStatementResParser, W as libsqlTransactionBatchReqStepsBuilder, z as libsqlTransactionBatchStreamResParser, mt as libsqlTransactionBeginStatement, dt as libsqlTransactionEndStatements, j as libsqlValueBuilder, qt as libsqlValueParser };
{
"name": "libsql-stateless-easy",
"version": "1.7.0",
"version": "1.7.1",
"description": "thin libSQL stateless http driver for TypeScript and JavaScript but easy",

@@ -36,2 +36,3 @@ "homepage": "https://github.com/DaBigBlob/libsql-stateless-easy#readme",

"devDependencies": {
"js-base64": "^3.7.7",
"tsup": "^8.0.2",

@@ -66,4 +67,4 @@ "typescript": "^5.0.0"

"dependencies": {
"libsql-stateless": "^2.8.5"
"libsql-stateless": "^2.8.6"
}
}

@@ -5,6 +5,6 @@ # libsql-stateless-easy

- ✅ **Supported runtime environments:** Web API (browser, serverless), Bun, Node.js (>=18)
- ✅ **Is extremely light:** 8.82kB (unpacked)* / 3.8kB (gzipped)
- ✅ **Is extremely light:** 8.79kB (unpacked)* / 3.8kB (gzipped)
- ✅ **Is built for:** Quick stateless query execution. (Mainly for serverless and edge functions.)
- ✅ Supports everything in `@libsql/client/web` **except `interactive transactions`.
- ✅ Unlike `@libsql/client/web`, **every function performs complete execution in exactly 1 roundtrip.**
- ✅ **Is Atomic and stateless**, every function performs complete execution in exactly 1 roundtrip.
- ✅ **`libsql-stateless-easy` is simply a drop-in replacement** and exactly same API as `@libsql/client/web`.

@@ -57,6 +57,2 @@

console.log(res2);
const res3 = await client.serverOk();
if (res3) console.log("Server Compat Check OK");
else console.error("Server Compat Check NOT OK");
```

@@ -82,3 +78,3 @@

- **This library has the exact `LibsqlError` API as `@libsql/client`**
- **This library has the same `LibsqlError` codes as `@libsql/client`**

@@ -98,6 +94,6 @@ ## Performance

### List of other stuff in this library
Feel free to explore them (however you dont need to as they've been neatly packaged into the `client`)
Feel free to explore them (however you don't need to as they've been neatly packaged into the `client`)
```ts
import {
libsqlValueBuilder, libsqlStatementBuilder, libsqlBatchReqStepsBuilder, libsqlBatchReqStepExecCondBuilder, libsqlTransactionBeginStatement,
libsqlValueBuilder, libsqlArgumentsBuilder, libsqlStatementBuilder, libsqlBatchReqStepsBuilder, libsqlBatchReqStepExecCondBuilder, libsqlTransactionBeginStatement,
libsqlValueParser, libsqlStatementResParser, libsqlBatchStreamResParser, libsqlTransactionBatchStreamResParser,

@@ -111,4 +107,6 @@ libsqlExecute, //has easier API than `libsql-stateless`'s function of the same name

```
## API Level
> NOTE: current API level is that of latest stable [libsql-stateless](https://github.com/DaBigBlob/libsql-stateless).
Read [this section](https://github.com/DaBigBlob/libsql-stateless/?tab=readme-ov-file#api-level).

Sorry, the diff of this file is not supported yet

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