mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
* 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
42 lines
1.1 KiB
Templ
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>
|
|
}
|