mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
22 lines
394 B
Text
22 lines
394 B
Text
|
---
|
||
|
/// <reference path="../../.astro/db-types.d.ts" />
|
||
|
import { Author, db } from 'astro:db';
|
||
|
|
||
|
await db
|
||
|
.insert(Author)
|
||
|
.values([
|
||
|
{ name: 'Ben' },
|
||
|
{ name: 'Nate' },
|
||
|
{ name: 'Erika' },
|
||
|
{ name: 'Bjorn' },
|
||
|
{ name: 'Sarah' },
|
||
|
]);
|
||
|
|
||
|
const authors = await db.select().from(Author);
|
||
|
---
|
||
|
|
||
|
<h2>Authors</h2>
|
||
|
<ul class="authors-list">
|
||
|
{authors.map((author) => <li>{author.name}</li>)}
|
||
|
</ul>
|