Skip to content

Commit

Permalink
Export type Database from db/runtime (#11216)
Browse files Browse the repository at this point in the history
* import and export in index.ts

* remove import and export from virtual.ts

* add changset

* Update .changeset/warm-pets-tap.md

Co-authored-by: Emanuele Stoppa <[email protected]>

---------

Co-authored-by: Emanuele Stoppa <[email protected]>
  • Loading branch information
OliverSpeir and ematipico authored Jun 10, 2024
1 parent 2bdca27 commit 29463df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-pets-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/db': patch
---

Export type `Database` from `@astrojs/db/runtime`
3 changes: 2 additions & 1 deletion packages/db/src/runtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
import type { DBColumn, DBTable } from '../core/types.js';
import { type SerializedSQL, isSerializedSQL } from './types.js';
import { pathToFileURL } from './utils.js';

import { type LibSQLDatabase } from 'drizzle-orm/libsql';
export type Database = Omit<LibSQLDatabase, 'transaction'>;
export type { Table } from './types.js';
export { createRemoteDatabaseClient, createLocalDatabaseClient } from './db-client.js';

Expand Down
4 changes: 0 additions & 4 deletions packages/db/src/runtime/virtual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import type {
TextColumnOpts,
} from '../core/types.js';

import type { LibSQLDatabase } from 'drizzle-orm/libsql';

export type Database = Omit<LibSQLDatabase, 'transaction'>;

function createColumn<S extends string, T extends Record<string, unknown>>(type: S, schema: T) {
return {
type,
Expand Down

0 comments on commit 29463df

Please sign in to comment.