mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -05:00
wip: update from seed file to data()
This commit is contained in:
parent
9e8fb5c388
commit
4633d37f8c
2 changed files with 36 additions and 16 deletions
|
@ -1,16 +0,0 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import db, { field } from '@astrojs/db';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
integrations: [db()],
|
||||
db: {
|
||||
collections: {
|
||||
Author: {
|
||||
fields: {
|
||||
name: field.text(),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
36
packages/db/test/fixtures/basics/astro.config.ts
vendored
Normal file
36
packages/db/test/fixtures/basics/astro.config.ts
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { defineConfig } from 'astro/config';
|
||||
import db, { defineCollection, field } from '@astrojs/db';
|
||||
|
||||
const Author = defineCollection({
|
||||
fields: {
|
||||
name: field.text(),
|
||||
},
|
||||
data() {
|
||||
return [
|
||||
{
|
||||
name: 'Ben',
|
||||
},
|
||||
{
|
||||
name: 'Nate',
|
||||
},
|
||||
{
|
||||
name: 'Erika',
|
||||
},
|
||||
{
|
||||
name: 'Bjorn',
|
||||
},
|
||||
{
|
||||
name: 'Sarah',
|
||||
},
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
integrations: [db()],
|
||||
db: {
|
||||
collections: { Author }
|
||||
}
|
||||
});
|
||||
|
Loading…
Add table
Reference in a new issue