Files
sonr/internal/dwn/front/scripts/navigator.templ
T
Prad NukalaandGitHub a115b79db7 feature/dwn echo middleware (#17)
* refactor: remove indexedDB dependency and replace with browser filesystem

* refactor: remove unused layout templating from global block

* feat: add support for building from source

* feat: add Credential creation and retrieval via Dexie database

* feat: add breadcrumbs component
2024-09-19 19:09:01 -04:00

42 lines
1.1 KiB
Templ

package scripts
templ CreateCredential() {
<script type="module">
// Import Dexie
import { Dexie } from 'https://unpkg.com/dexie/dist/modern/dexie.mjs';
// Create a new Dexie database
const db = new Dexie('myDatabase');
// Define the schema for the database
db.version(1).stores({
users: '++id, name, age',
posts: '++id, title, content, authorId',
comments: '++id, content, postId, authorId',
});
// Export the database instance
window.vault = db;
</script>
}
templ GetCredential() {
<script type="module">
// Import Dexie
import { Dexie } from 'https://unpkg.com/dexie/dist/modern/dexie.mjs';
// Create a new Dexie database
const db = new Dexie('myDatabase');
// Define the schema for the database
db.version(1).stores({
users: '++id, name, age',
posts: '++id, title, content, authorId',
comments: '++id, content, postId, authorId',
});
// Export the database instance
export default db;
</script>
}