0
Fork 0
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:
Chris Swithinbank 2024-03-08 02:21:03 +01:00 committed by GitHub
parent b6ccaa6dc7
commit 3f27e09628
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 22 additions and 14 deletions

View 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”.

View file

@ -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: {}
});
`,

View file

@ -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;
}

View file

@ -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 },
});

View file

@ -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 },
});

View file

@ -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,
},

View file

@ -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 },
});

View file

@ -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 } });

View file

@ -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;
}