MCPcopy Create free account
hub / github.com/PleasureTools/joyBox / IsInitialized

Method IsInitialized

backend/Src/Services/SqliteAdapter.ts:113–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111 }
112
113 public IsInitialized(): boolean {
114 const requiredTables = ['observables', 'observablePlugins', 'plugins', 'archive'];
115
116 const tblExistStmt = this.db.prepare(
117 'SELECT count(*) as exist FROM sqlite_master WHERE type=\'table\' AND name=(?)'
118 );
119 return requiredTables
120 .map(x => tblExistStmt.get(x).exist === 1)
121 .every(x => x);
122 }
123
124 public AddObservable(observable: ObservableStream): boolean {
125 const addObservableStmt = this.db.prepare('INSERT INTO observables (url) VALUES (@url)');

Callers 1

RunMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected