mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
chore: expose setMeta for unit testing
This commit is contained in:
parent
452a3c8581
commit
aa00edea81
1 changed files with 6 additions and 2 deletions
|
@ -114,7 +114,9 @@ function astroDBIntegration(): AstroIntegration {
|
|||
}, 100);
|
||||
},
|
||||
'astro:build:start': async ({ logger }) => {
|
||||
logger.info('database: ' + (connectedToRemote ? yellow('remote') : blue('local database.')));
|
||||
logger.info(
|
||||
'database: ' + (connectedToRemote ? yellow('remote') : blue('local database.'))
|
||||
);
|
||||
},
|
||||
'astro:build:done': async ({ }) => {
|
||||
await appToken?.destroy();
|
||||
|
@ -127,8 +129,10 @@ function astroDBIntegration(): AstroIntegration {
|
|||
* We need to attach the Drizzle `table` and collection name at runtime.
|
||||
* These cannot be determined from `defineCollection()`,
|
||||
* since we don't know the collection name until the `db` config is resolved.
|
||||
*
|
||||
* exported for unit testing.
|
||||
*/
|
||||
function setCollectionsMeta(collections: Record<string, any>) {
|
||||
export function setCollectionsMeta(collections: Record<string, any>) {
|
||||
for (const [name, collection] of Object.entries(collections)) {
|
||||
const table = collectionToTable(name, collection);
|
||||
collection._setMeta?.({ table });
|
||||
|
|
Loading…
Add table
Reference in a new issue