Allow dynamically creating tables
All checks were successful
Build / Build NPM Project (push) Successful in 48s
Build / Tag Version (push) Successful in 7s
Build / Publish Documentation (push) Successful in 42s

This commit is contained in:
2025-06-16 20:56:28 -04:00
parent c06538a725
commit 1877bac7ce
3 changed files with 88 additions and 19 deletions

View File

@ -3,8 +3,17 @@
<script type="module">
import {Cache, Database} from './dist/index.mjs';
const db = new Database('test', [123]);
window['table'] = db.table(123);
const db = new Database('test');
db.connection.then(() => {
console.log(db.tables);
});
const table = window.table = await db.createTable('test2');
table.add({ name: 'Alice', age: 30 });
table.add({ name: 'Bob', age: 24 });
table.add({ name: 'Carol', age: 30 });
console.log(db.tables);
</script>
</body>
</html>