Skip to content

Commit

Permalink
Merge branch 'main' into evanhahn/576
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn authored May 16, 2024
2 parents 3d4a667 + 2eda126 commit 5fb358a
Show file tree
Hide file tree
Showing 28 changed files with 921 additions and 626 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
*.snapshot.cjs
/tests/fixtures/
/docs/
/coverage/
/proto/build/
181 changes: 181 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions test-types/schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { drizzle } from 'drizzle-orm/better-sqlite3'
import Database from 'better-sqlite3'
import { deNullify } from '../src/utils.js'
import type { MapeoDoc, MapeoValue } from '@mapeo/schema'
import * as projectTableSchemas from '../src/schema/project.js'

const sqlite = new Database(':memory:')
const db = drizzle(sqlite)

const { observationTable, presetTable, fieldTable } = projectTableSchemas

const oResult = db.select().from(observationTable).get()!
const pResult = db.select().from(presetTable).get()!
const fResult = db.select().from(fieldTable).get()!

type MapeoType<T> = Extract<MapeoValue, { schemaName: T }>
const _o: MapeoType<'observation'> = deNullify(oResult)
const _p: MapeoType<'preset'> = deNullify(pResult)
const _f: MapeoType<'field'> = deNullify(fResult)
2 changes: 1 addition & 1 deletion test-types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"rootDir": ".."
},
"files": [],
"include": ["../dist", "."]
"include": ["../dist", "../types/**/*.d.ts", "."]
}
Loading

0 comments on commit 5fb358a

Please sign in to comment.