libsql-stateless
Advanced tools
Comparing version 2.8.4 to 2.8.5
@@ -11,2 +11,3 @@ type libsqlResult<T, E> = { | ||
authToken?: string; | ||
fetch?: typeof fetch; | ||
}; | ||
@@ -13,0 +14,0 @@ type libsqlError = { |
@@ -1,3 +0,3 @@ | ||
async function r(e){let s=await fetch(`${e.conf.db_url}/v3/pipeline`,{method:"POST",headers:e.conf.authToken?{Authorization:"Bearer "+e.conf.authToken}:void 0,body:JSON.stringify(e.req_json)});return s.ok&&s.headers.get("content-type")==="application/json"?{isOk:!0,val:await s.json()}:{isOk:!1,err:{kind:"LIBSQL_SERVER_ERROR",server_message:await(async()=>{try{return await s.text()}catch{return null}})(),http_status_code:s.status}}}async function i(e,s){let l=await r({conf:e,req_json:{baton:null,requests:[{type:"execute",stmt:s},{type:"close"}]}});if(l.isOk){let t=l.val.results[0];return t.type=="ok"&&t.response.type=="execute"?{isOk:!0,val:t.response.result}:{isOk:!1,err:{kind:"LIBSQL_RESPONSE_ERROR",data:t.error}}}else return l}async function n(e,s){let l=await r({conf:e,req_json:{baton:null,requests:[{type:"batch",batch:{steps:s}},{type:"close"}]}});if(l.isOk){let t=l.val.results[0];return t.type=="ok"&&t.response.type=="batch"?{isOk:!0,val:t.response.result}:{isOk:!1,err:{kind:"LIBSQL_RESPONSE_ERROR",data:t.error}}}else return l}async function a(e){return (await fetch(`${e.db_url}/v3`,{method:"GET"})).ok?{isOk:!0,val:null}:{isOk:!1,err:null}} | ||
async function r(e){let s=await(e.conf.fetch||globalThis.fetch)(`${e.conf.db_url}/v3/pipeline`,{method:"POST",headers:e.conf.authToken?{Authorization:"Bearer "+e.conf.authToken}:void 0,body:JSON.stringify(e.req_json)});return s.ok?{isOk:!0,val:await s.json()}:{isOk:!1,err:{kind:"LIBSQL_SERVER_ERROR",server_message:await(async()=>{try{return await s.text()}catch{return null}})(),http_status_code:s.status}}}async function i(e,s){let t=await r({conf:e,req_json:{baton:null,requests:[{type:"execute",stmt:s},{type:"close"}]}});if(t.isOk){let l=t.val.results[0];return l.type=="ok"?{isOk:!0,val:l.response.result}:{isOk:!1,err:{kind:"LIBSQL_RESPONSE_ERROR",data:l.error}}}else return t}async function a(e,s){let t=await r({conf:e,req_json:{baton:null,requests:[{type:"batch",batch:{steps:s}},{type:"close"}]}});if(t.isOk){let l=t.val.results[0];return l.type=="ok"?{isOk:!0,val:l.response.result}:{isOk:!1,err:{kind:"LIBSQL_RESPONSE_ERROR",data:l.error}}}else return t}async function n(e){return (await fetch(`${e.db_url}/v3`,{method:"GET"})).ok?{isOk:!0,val:null}:{isOk:!1,err:null}} | ||
export { n as libsqlBatch, i as libsqlExecute, a as libsqlServerCompatCheck }; | ||
export { a as libsqlBatch, i as libsqlExecute, n as libsqlServerCompatCheck }; |
{ | ||
"name": "libsql-stateless", | ||
"version": "2.8.4", | ||
"version": "2.8.5", | ||
"description": "thin libSQL stateless http driver for TypeScript and JavaScript", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/DaBigBlob/libsql-stateless#readme", |
@@ -8,3 +8,3 @@ # libsql-stateless | ||
- ✅ **Has no premature optimizations.** | ||
- ✅ **Is extremely light:** 12.1kB (unpacked)/ 4.3kB (package)/ 1.4kB (minified)/ 662B (minified+gzipped) | ||
- ✅ **Is extremely light:** 1.16kB (unpacked)* | ||
- ✅ Unlike `@libsql/client/web`, **every function performs complete execution in exactly 1 roundtrip.** | ||
@@ -16,2 +16,3 @@ - ✅ **Is built for:** Quick stateless query execution. (Mainly for serverless and edge functions.) | ||
\* The actual js that is included with your project. (Excluding the type definitions and 2 copies of the main js for esm and cjs. (because you're gonna use one of them)) | ||
<br> | ||
@@ -18,0 +19,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
168
37
2
12108