Skip to content

Commit

Permalink
feat: overhaul everything again and add update schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
rintaun committed Dec 13, 2022
1 parent 4c0436e commit 83b012e
Show file tree
Hide file tree
Showing 8 changed files with 440 additions and 297 deletions.
307 changes: 176 additions & 131 deletions src/datasource/DBDataSource.ts

Large diffs are not rendered by default.

30 changes: 18 additions & 12 deletions src/datasource/__tests__/DBDataSource.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,25 @@ describe(DBDataSource, () => {

const factory = new LoaderFactory(dummyBatchFn, dummyBatchFn, DummyMetadata)

class DummyDBDataSource extends DBDataSource<
typeof DummyMetadata,
typeof DummyRowType,
typeof DummyRowType
> {
class DummyDBDataSource extends DBDataSource<{
name: 'any_table'
metadata: typeof DummyMetadata
schemas: {
select: typeof DummyRowType
insert: typeof DummyRowType
update: typeof DummyRowType
}
}> {
constructor() {
super(
createMockPool(),
'any_table',
DummyMetadata,
DummyRowType /* select */,
DummyRowType /* insert */
)
super(createMockPool(), {
name: 'any_table',
metadata: DummyMetadata,
schemas: {
select: DummyRowType,
insert: DummyRowType,
update: DummyRowType,
},
})
}

protected get loaders() {
Expand Down

0 comments on commit 83b012e

Please sign in to comment.