@knockdata/objectexplorer 0.3.16 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/WorkerParser.js +119 -119
- package/app/assets/__vite-browser-external.js +1 -0
- package/app/assets/browser-2.js +1 -0
- package/app/assets/browser-3.js +1 -0
- package/app/assets/browser-4.js +1 -0
- package/app/assets/browser.js +2 -2
- package/app/assets/duckdb.js +1 -1
- package/app/assets/duckdbEntry.js +8 -0
- package/app/assets/duckdbWasm.js +1 -0
- package/app/assets/index.css +1 -1
- package/app/assets/index.js +8 -8
- package/app/assets/node-2.js +1 -0
- package/app/assets/node.js +1 -1
- package/app/assets/rolldown-runtime.js +1 -0
- package/app/assets/rows.js +1 -0
- package/app/assets/sqlite-2.js +1 -1
- package/app/assets/sqlite.js +1 -1
- package/app/assets/sqliteEntry.js +1 -0
- package/app/assets/sqliteWasm.js +1 -0
- package/app/assets/wasm-worker.js +2 -7800
- package/cli.js +19 -4
- package/package.json +10 -7
- package/server/WebServer.mjs +318 -8132
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{t as e}from"./rows.js";function t(t){return{getEntries:a,getEntry:c};async function a(e,t=``){let n=String(t||``).split(`/`).filter(Boolean);return n.length===0?await o(e):n.length===1?await s(e,n[0]):[]}async function o(e){return(await t(`SELECT schema_name FROM duckdb_schemas() WHERE database_name = current_database() ORDER BY schema_name`)).map(t=>({name:t.schema_name,label:t.schema_name,type:`schema`,objectKind:`folder`,path:`${e}/${t.schema_name}`}))}async function s(e,n){return(await t(`SELECT table_name AS name,
|
|
2
|
+
CASE WHEN table_type = 'VIEW' THEN 'view' ELSE 'table' END AS type
|
|
3
|
+
FROM information_schema.tables
|
|
4
|
+
WHERE table_catalog = current_database() AND table_schema = ${r(n)}
|
|
5
|
+
ORDER BY type, name`)).map(t=>({name:t.name,label:t.name,type:t.type,objectKind:t.type,path:`${e}/${n}/${t.name}`}))}async function c(a,o=0,s=1e3){let{schema:c,table:l}=i(a),u=`${n(c)}.${n(l)}`,d=(await t(`SELECT column_name FROM information_schema.columns
|
|
6
|
+
WHERE table_catalog = current_database()
|
|
7
|
+
AND table_schema = ${r(c)} AND table_name = ${r(l)}
|
|
8
|
+
ORDER BY ordinal_position`)).map(e=>e.column_name),f=Number((await t(`SELECT COUNT(*) AS total FROM ${u}`))[0].total);return{rows:(await t(`SELECT * FROM ${u} LIMIT ${Number(s)} OFFSET ${Number(o)}`)).map(e),columns:d,total:f,offset:o,limit:s}}}function n(e){return`"${String(e).replaceAll(`"`,`""`)}"`}function r(e){return`'${String(e).replaceAll(`'`,`''`)}'`}function i(e){let t=String(e||``).split(`/`).filter(Boolean);return t.length>1?{schema:t[0],table:t[1]}:{schema:`main`,table:t[0]}}export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./browser.js";const t=`wasm`,n=new URL(`../duckdb/duckdb.wasm`,self.location.href).href;let r=null;function i(){return r===null&&(r=a().then(e)),r}async function a(){let e=await o(),t=await s(e,`wasm`);return t||(t=await(await fetch(n)).arrayBuffer(),await c(e,`wasm`,t)),t}async function o(){return new Promise((e,n)=>{let r=indexedDB.open(`duckdb-cache`,1);r.onupgradeneeded=e=>e.target.result.createObjectStore(t),r.onsuccess=t=>e(t.target.result),r.onerror=n})}async function s(e,n){return new Promise(r=>{let i=e.transaction(t).objectStore(t).get(n);i.onsuccess=e=>r(e.target.result),i.onerror=()=>r(null)})}async function c(e,n,r){return new Promise((i,a)=>{let o=e.transaction(t,`readwrite`);o.objectStore(t).put(r,n),o.oncomplete=i,o.onerror=a})}export{i as default};
|