openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 601 B
JavaScript
import{u as e}from"./openclaw-state-read-sqlite-post-commit-CsXPYVOo.mjs";import{T as t,h as n,o as r}from"./openclaw-state-read-sqlite-schema-facts-Dtolu7-X.mjs";import{i}from"./openclaw-state-read-sqlite-transaction-Bt-IwVhZ.mjs";function createSqliteSchemaEnsurer(a,o){let present=e=>{let t=r(e);return t!==void 0&&o.tables.every(e=>t.tables.has(e))&&(o.indexes?.every(e=>t.indexes.has(e))??!0)};return(r,o)=>{e(r)&&t(`postgres`,`repair`),n(r,()=>{if(present(r))return;let install=e=>e.exec(a());o?o(install):r.isTransaction?install(r):i(r,()=>install(r))})}}export{createSqliteSchemaEnsurer as t};