mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -05:00
Rename defineDB
to defineDb
(#10364)
* Rename `defineDB` to `defineDb` * Add changeset * Improve changeset
This commit is contained in:
parent
b6ccaa6dc7
commit
3f27e09628
9 changed files with 22 additions and 14 deletions
8
.changeset/wet-kiwis-laugh.md
Normal file
8
.changeset/wet-kiwis-laugh.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
"@astrojs/db": minor
|
||||
"astro": patch
|
||||
---
|
||||
|
||||
Renames the Astro DB `defineDB()` helper to `defineDb()`
|
||||
|
||||
⚠️ Breaking change: update your imports from `astro:db` to use `defineDb` with a lowercase “b”.
|
|
@ -71,10 +71,10 @@ export default {
|
|||
public-hoist-pattern[]=*lit*
|
||||
`,
|
||||
DB_CONFIG: `\
|
||||
import { defineDB } from 'astro:db';
|
||||
import { defineDb } from 'astro:db';
|
||||
|
||||
// https://astro.build/db/config
|
||||
export default defineDB({
|
||||
export default defineDb({
|
||||
tables: {}
|
||||
});
|
||||
`,
|
||||
|
|
|
@ -41,7 +41,7 @@ export function defineTable<TColumns extends ColumnsConfig>(userConfig: TableCon
|
|||
return userConfig;
|
||||
}
|
||||
|
||||
export function defineDB(userConfig: DBConfigInput) {
|
||||
export function defineDb(userConfig: DBConfigInput) {
|
||||
return userConfig;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Themes } from './theme';
|
||||
import { column, defineDB, defineTable } from 'astro:db';
|
||||
import { column, defineDb, defineTable } from 'astro:db';
|
||||
|
||||
const Author = defineTable({
|
||||
columns: {
|
||||
|
@ -8,6 +8,6 @@ const Author = defineTable({
|
|||
},
|
||||
});
|
||||
|
||||
export default defineDB({
|
||||
export default defineDb({
|
||||
tables: { Author, Themes },
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { column, defineDB, defineTable } from 'astro:db';
|
||||
import { column, defineDb, defineTable } from 'astro:db';
|
||||
|
||||
const Author = defineTable({
|
||||
columns: {
|
||||
|
@ -7,6 +7,6 @@ const Author = defineTable({
|
|||
},
|
||||
});
|
||||
|
||||
export default defineDB({
|
||||
export default defineDb({
|
||||
tables: { Author },
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { menu } from './shared';
|
||||
import { defineDB } from 'astro:db';
|
||||
import { defineDb } from 'astro:db';
|
||||
|
||||
export default defineDB({
|
||||
export default defineDb({
|
||||
tables: {
|
||||
menu,
|
||||
},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { column, defineDB, defineTable } from 'astro:db';
|
||||
import { column, defineDb, defineTable } from 'astro:db';
|
||||
|
||||
const Recipe = defineTable({
|
||||
columns: {
|
||||
|
@ -21,6 +21,6 @@ const Ingredient = defineTable({
|
|||
foreignKeys: [{ columns: 'recipeId', references: () => [Recipe.columns.id] }],
|
||||
});
|
||||
|
||||
export default defineDB({
|
||||
export default defineDb({
|
||||
tables: { Recipe, Ingredient },
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { column, defineDB, defineTable } from 'astro:db';
|
||||
import { column, defineDb, defineTable } from 'astro:db';
|
||||
|
||||
const Event = defineTable({
|
||||
columns: {
|
||||
|
@ -24,4 +24,4 @@ const Ticket = defineTable({
|
|||
},
|
||||
});
|
||||
|
||||
export default defineDB({ tables: { Event, Ticket } });
|
||||
export default defineDb({ tables: { Event, Ticket } });
|
||||
|
|
2
packages/db/virtual.d.ts
vendored
2
packages/db/virtual.d.ts
vendored
|
@ -4,6 +4,6 @@ declare module 'astro:db' {
|
|||
export const TRUE: typeof import('./dist/runtime/config.js').TRUE;
|
||||
export const FALSE: typeof import('./dist/runtime/config.js').FALSE;
|
||||
export const column: typeof import('./dist/runtime/config.js').column;
|
||||
export const defineDB: typeof import('./dist/runtime/config.js').defineDB;
|
||||
export const defineDb: typeof import('./dist/runtime/config.js').defineDb;
|
||||
export const defineTable: typeof import('./dist/runtime/config.js').defineTable;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue