openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 827 B
JavaScript
import{u as e}from"./openclaw-state-read-sqlite-post-commit-CEHMNIsB.mjs";import{n as t,t as n}from"./openclaw-state-read-openclaw-state-db-DnrW7QY9.mjs";import{Ht as r,Pt as i}from"./openclaw-state-read.worker.js";import{t as a}from"./openclaw-state-read-sqlite-schema-ensure-BO_Zg9-7.mjs";import{t as o}from"./openclaw-state-read-openclaw-state-feature-schema-BPVIIoAx.mjs";function createOpenClawStateSchemaEnsurer(s){let c=o(s.table,{endMarker:s.endMarker??`
) STRICT;
`,errorMessage:`Canonical state schema markers are missing for ${s.table}`}),l=a(()=>c,{tables:[s.table,...s.additionalTables??[]],indexes:s.indexes});return(a={})=>{let{db:o}=n(a),runWrite=n=>t(({db:t})=>{e(t)?i(t,s.table):n(t)},a,{operationLabel:s.operationLabel});e(o)?r(o,()=>runWrite(l)):l(o,runWrite)}}export{createOpenClawStateSchemaEnsurer as t};