Skip to content

Commit

Permalink
wip: demo ready
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Mar 1, 2024
1 parent aba33ee commit 37585ce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
17 changes: 15 additions & 2 deletions packages/db/test/fixtures/basics/db/config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
import { defineDB, defineTable, column } from 'astro:db';
import { Themes } from './theme';
import { defineDB, defineTable, column, sql, NOW } from 'astro:db';

const Author = defineTable({
columns: {
name: column.text(),
},
});

const Themes = defineTable({
columns: {
name: column.text(),
added: column.date({
default: sql`CURRENT_TIMESTAMP`,
}),
updated: column.date({
default: NOW,
}),
isDark: column.boolean({ default: sql`TRUE` }),
owner: column.text({ optional: true, default: sql`NULL` }),
},
});

export default defineDB({
tables: { Author, Themes },
});
6 changes: 1 addition & 5 deletions packages/db/test/fixtures/basics/db/seed.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { db, Author } from 'astro:db';
import { Themes as ThemesConfig } from './theme';
import { asDrizzleTable } from '@astrojs/db/utils';

const Themes = asDrizzleTable('Themes', ThemesConfig);
import { db, Themes, Author } from 'astro:db';

await db
.insert(Themes)
Expand Down
15 changes: 0 additions & 15 deletions packages/db/test/fixtures/basics/db/theme.ts

This file was deleted.

0 comments on commit 37585ce

Please sign in to comment.