Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version v1.0.0-138 #2197

Merged
merged 6 commits into from
Jan 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## v1.0.0-138


### 🩹 Fixes

- Fix select issue ([aea8243](https://github.com/undb-io/undb/commit/aea8243))

### ❤️ Contributors

- Nichenqin ([@nichenqin](http://github.com/nichenqin))

## v1.0.0-137


10 changes: 5 additions & 5 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
@@ -8,8 +8,8 @@
"build:docker": "bun build --compile src/index.ts --target=bun --packages=external --sourcemap --outfile undb"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.717.0",
"@aws-sdk/s3-request-presigner": "^3.717.0",
"@aws-sdk/client-s3": "^3.726.0",
"@aws-sdk/s3-request-presigner": "^3.726.0",
"@elysiajs/cors": "1.1.0",
"@elysiajs/cron": "1.1.0",
"@elysiajs/html": "1.1.0",
@@ -43,8 +43,8 @@
"@undb/trpc": "workspace:*",
"@undb/webhook": "workspace:*",
"arctic": "^2.3.3",
"bun": "^1.1.42",
"core-js": "^3.39.0",
"bun": "^1.1.43",
"core-js": "^3.40.0",
"elysia": "1.1.7",
"got": "^14.4.5",
"handlebars": "^4.7.8",
@@ -56,7 +56,7 @@
"oslo": "^1.2.1",
"radash": "^12.1.0",
"reflect-metadata": "^0.2.2",
"uuid": "^11.0.3",
"uuid": "^11.0.5",
"xlsx": "^0.18.5"
},
"devDependencies": {
6 changes: 3 additions & 3 deletions apps/backend/src/modules/auth/auth.provider.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BunSQLiteAdapter, LibSQLAdapter } from "@lucia-auth/adapter-sqlite"
import { container, inject, instanceCachingFactory } from "@undb/di"
import { env } from "@undb/env"
import { Client, SQLITE_CLIENT } from "@undb/persistence/server"
import { Client, DATABASE_CLIENT } from "@undb/persistence/server"
import Database from "bun:sqlite"
import { Adapter, Lucia } from "lucia"

@@ -72,10 +72,10 @@ declare module "lucia" {
container.register(LUCIA_PROVIDER, {
useFactory: instanceCachingFactory((c) => {
if (env.UNDB_DB_PROVIDER === "sqlite" || !env.UNDB_DB_PROVIDER) {
const sqlite = c.resolve<Database>(SQLITE_CLIENT)
const sqlite = c.resolve<Database>(DATABASE_CLIENT)
return createSqliteLucia(sqlite)
}
const sqlite = c.resolve<Client>(SQLITE_CLIENT)
const sqlite = c.resolve<Client>(DATABASE_CLIENT)
return createTursoLucia(sqlite)
}),
})
4 changes: 1 addition & 3 deletions apps/backend/src/modules/space/space.module.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import { getCurrentMember } from "@undb/context/server"
import { CommandBus } from "@undb/cqrs"
import { inject, singleton } from "@undb/di"
import type { ITxContext } from "@undb/persistence/server"
import { injectQueryBuilder, injectTxCTX, type IQueryBuilder } from "@undb/persistence/server"
import { injectTxCTX } from "@undb/persistence/server"
import { injectSpaceService, type ISpaceService } from "@undb/space"
import Elysia, { t } from "elysia"
import { type Lucia } from "lucia"
@@ -20,8 +20,6 @@ export class SpaceModule {
private readonly spaceService: ISpaceService,
@inject(CommandBus)
private readonly commandBus: CommandBus,
@injectQueryBuilder()
private readonly qb: IQueryBuilder,
@injectContext()
private readonly context: IContext,
@injectTxCTX()
8 changes: 4 additions & 4 deletions apps/backend/src/registry/db.registry.ts
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@ import {
DashboardOutboxService,
DashboardQueryRepository,
DashboardRepository,
DATABASE_CLIENT,
InvitationQueryRepository,
InvitationRepository,
QUERY_BUILDER,
@@ -43,7 +44,6 @@ import {
SpaceMemberRepository,
SpaceQueryRepository,
SpaceRepostitory,
SQLITE_CLIENT,
TableOutboxService,
TableQueryRepository,
TableRepository,
@@ -78,7 +78,7 @@ export const registerDb = () => {
container.register(CTX, { useValue: txContext })
container.register(TX_CTX, TxContextImpl)

container.register(SQLITE_CLIENT, {
container.register(DATABASE_CLIENT, {
useFactory: instanceCachingFactory(() => {
if (env.UNDB_DB_PROVIDER === "sqlite" || !env.UNDB_DB_PROVIDER) {
return createSqliteClient("undb.sqlite")
@@ -89,10 +89,10 @@ export const registerDb = () => {
container.register(QUERY_BUILDER, {
useFactory: instanceCachingFactory((c) => {
if (env.UNDB_DB_PROVIDER === "sqlite" || !env.UNDB_DB_PROVIDER) {
const sqlite = c.resolve<Database>(SQLITE_CLIENT)
const sqlite = c.resolve<Database>(DATABASE_CLIENT)
return createSqliteQueryBuilder(sqlite)
}
const sqlite = c.resolve<Client>(SQLITE_CLIENT)
const sqlite = c.resolve<Client>(DATABASE_CLIENT)
return createTursoQueryBuilder(sqlite)
}),
})
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
},
"devDependencies": {
"@tauri-apps/cli": "^1.6.3",
"typescript": "^5.7.2",
"typescript": "^5.7.3",
"vite": "^5.4.11"
}
}
40 changes: 20 additions & 20 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
@@ -14,23 +14,23 @@
"clean": "bunx rimraf node_modules"
},
"devDependencies": {
"@fontsource/fira-mono": "^5.1.0",
"@fontsource/fira-mono": "^5.1.1",
"@jhubbardsf/svelte-sortablejs": "latest",
"@jimmyverburgt/svelte-input-otp": "^0.0.3",
"@neoconfetti/svelte": "^2.2.1",
"@svelte-put/copy": "^4.0.0",
"@svelte-put/shortcut": "^4.1.0",
"@sveltejs/adapter-static": "^3.0.8",
"@sveltejs/kit": "^2.15.0",
"@sveltejs/kit": "^2.15.2",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@tailwindcss/typography": "^0.5.15",
"@tanstack/eslint-plugin-query": "^5.62.9",
"@tailwindcss/typography": "^0.5.16",
"@tanstack/eslint-plugin-query": "^5.62.16",
"@types/eslint": "^9.6.1",
"@types/lodash.unzip": "^3.4.9",
"@types/papaparse": "^5.3.15",
"@types/sortablejs": "latest",
"@typescript-eslint/eslint-plugin": "^8.18.2",
"@typescript-eslint/parser": "^8.18.2",
"@typescript-eslint/eslint-plugin": "^8.19.1",
"@typescript-eslint/parser": "^8.19.1",
"@undb/commands": "workspace:*",
"@undb/command-handlers": "workspace:*",
"@undb/query-handlers": "workspace:*",
@@ -56,18 +56,18 @@
"houdini": "^1.4.0",
"houdini-svelte": "^2.1.0",
"lodash.unzip": "^3.4.0",
"papaparse": "^5.4.1",
"papaparse": "^5.5.0",
"postcss": "^8.4.49",
"postcss-load-config": "^6.0.1",
"prettier": "^3.4.2",
"prettier-plugin-svelte": "^3.3.2",
"prettier-plugin-tailwindcss": "^0.6.9",
"radash": "^12.1.0",
"rollup-plugin-visualizer": "^5.12.0",
"rollup-plugin-visualizer": "^5.14.0",
"safe-flat": "^2.1.0",
"sortablejs": "^1.15.6",
"svelte": "^5.16.0",
"svelte-check": "^4.1.1",
"svelte": "^5.17.3",
"svelte-check": "^4.1.3",
"svelte-headless-table": "^0.18.3",
"svelte-inview": "^4.0.4",
"svelte-jsoneditor": "^2.3.3",
@@ -77,8 +77,8 @@
"tailwindcss": "^3.4.17",
"timeago.js": "^4.0.2",
"tslib": "^2.8.1",
"type-fest": "^4.31.0",
"typescript": "^5.7.2",
"type-fest": "^4.32.0",
"typescript": "^5.7.3",
"vite": "^5.4.11",
"vite-plugin-node-polyfills": "^0.22.0",
"vitest": "^2.1.8",
@@ -87,25 +87,25 @@
"type": "module",
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
"@codemirror/commands": "^6.7.1",
"@codemirror/commands": "^6.8.0",
"@codemirror/language": "^6.10.8",
"@codemirror/state": "^6.5.0",
"@codemirror/view": "^6.36.1",
"@floating-ui/dom": "^1.6.12",
"@codemirror/view": "^6.36.2",
"@floating-ui/dom": "^1.6.13",
"@formkit/auto-animate": "^0.8.2",
"@internationalized/date": "^3.6.0",
"@svelte-put/clickoutside": "^4.0.0",
"@tanstack/svelte-query": "^5.62.9",
"@tanstack/svelte-query": "^5.62.16",
"@tanstack/svelte-virtual": "^3.11.2",
"@tiptap/core": "^2.10.4",
"@tiptap/pm": "^2.10.4",
"@tiptap/starter-kit": "^2.10.4",
"@tiptap/core": "^2.11.0",
"@tiptap/pm": "^2.11.0",
"@tiptap/starter-kit": "^2.11.0",
"@trpc/client": "^10.45.2",
"@undb/zod": "workspace:*",
"bits-ui": "^0.22.0",
"clsx": "^2.1.1",
"cmdk-sv": "^0.0.18",
"embla-carousel-svelte": "^8.5.1",
"embla-carousel-svelte": "^8.5.2",
"formsnap": "^1.0.1",
"fuse.js": "^7.0.0",
"lucide-svelte": "^0.469.0",
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@
$updateCell.mutate({
tableId,
id: recordId,
values: { [field.id.value]: value },
values: { [field.id.value]: id },
})
}
</script>
Binary file modified bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "undb",
"version": "1.0.0-137",
"version": "1.0.0-138",
"private": true,
"scripts": {
"build": "NODE_ENV=production bun --bun turbo build",
@@ -28,7 +28,7 @@
"devDependencies": {
"drizzle-kit": "^0.30.1",
"husky": "^9.1.7",
"lint-staged": "^15.2.11",
"lint-staged": "^15.3.0",
"npm-run-all2": "^7.0.2",
"prettier": "^3.4.2",
"turbo": "^2.3.3"
@@ -39,7 +39,7 @@
"engines": {
"node": ">=18"
},
"packageManager": "bun@1.1.42",
"packageManager": "bun@1.1.43",
"workspaces": [
"apps/*",
"packages/*"
4 changes: 2 additions & 2 deletions packages/cqrs/package.json
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"devDependencies": {
"@types/bun": "latest",
"@types/uuid": "^10.0.0",
"type-fest": "^4.31.0"
"type-fest": "^4.32.0"
},
"peerDependencies": {
"typescript": "^5.0.0"
@@ -17,6 +17,6 @@
"@undb/logger": "workspace:*",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"uuid": "^11.0.3"
"uuid": "^11.0.5"
}
}
2 changes: 1 addition & 1 deletion packages/domain/package.json
Original file line number Diff line number Diff line change
@@ -16,6 +16,6 @@
"dequal": "^2.0.3",
"nanoid": "^5.0.9",
"oxide.ts": "^1.1.0",
"uuid": "^11.0.3"
"uuid": "^11.0.5"
}
}
2 changes: 1 addition & 1 deletion packages/persistence/package.json
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@
"@undb/webhook": "workspace:*",
"date-fns": "^4.1.0",
"drizzle-orm": "^0.38.3",
"es-toolkit": "^1.30.1",
"es-toolkit": "^1.31.0",
"kysely": "^0.27.5",
"kysely-bun-sqlite": "^0.3.2",
"kysely-wasm": "^0.7.0",
4 changes: 0 additions & 4 deletions packages/persistence/src/base/base.repository.ts
Original file line number Diff line number Diff line change
@@ -13,8 +13,6 @@ import { None, Some, type Option } from "@undb/domain"
import { injectTableRepository, TableBaseIdSpecification, type ITableRepository } from "@undb/table"
import type { ITxContext } from "../ctx.interface"
import { injectTxCTX } from "../ctx.provider"
import { injectQueryBuilder } from "../qb.provider"
import type { IQueryBuilder } from "../qb.type"
import { UnderlyingTableService } from "../underlying/underlying-table.service"
import { BaseFilterVisitor } from "./base.filter-visitor"
import { BaseMapper } from "./base.mapper"
@@ -27,8 +25,6 @@ export class BaseRepository implements IBaseRepository {
private readonly mapper: BaseMapper,
@injectBaseOutboxService()
private readonly outboxService: IBaseOutboxService,
@injectQueryBuilder()
private readonly qb: IQueryBuilder,
@injectTableRepository()
private readonly tableRepository: ITableRepository,
@inject(UnderlyingTableService)
16 changes: 10 additions & 6 deletions packages/persistence/src/dashboard/dashboard.repository.ts
Original file line number Diff line number Diff line change
@@ -35,21 +35,23 @@ export class DashboardRepository implements IDashboardRepository {
) {}

async find(spec: IDashboardSpecification): Promise<Dashboard[]> {
const dashboards = await this.qb
const trx = this.txContext.getCurrentTransaction()
const dashboards = await trx
.selectFrom("undb_dashboard")
.selectAll()
.$call((qb) => new DashboardReferenceVisitor(qb).call(spec))
.where((eb) => new DashboardFilterVisitor(eb, this.qb).$where(spec))
.where((eb) => new DashboardFilterVisitor(eb, trx).$where(spec))
.execute()

return dashboards.map((dashboard) => this.mapper.toDo(dashboard))
}
async findOne(spec: IDashboardSpecification): Promise<Option<Dashboard>> {
const dashboard = await this.qb
const trx = this.txContext.getCurrentTransaction()
const dashboard = await trx
.selectFrom("undb_dashboard")
.selectAll()
.$call((qb) => new DashboardReferenceVisitor(qb).call(spec))
.where((eb) => new DashboardFilterVisitor(eb, this.qb).$where(spec))
.where((eb) => new DashboardFilterVisitor(eb, trx).$where(spec))
.executeTakeFirst()

return dashboard ? Some(this.mapper.toDo(dashboard)) : None
@@ -58,11 +60,13 @@ export class DashboardRepository implements IDashboardRepository {
const spaceId = this.context.mustGetCurrentSpaceId()
const spec = WithDashboardId.fromString(id).and(new WithDashboardSpaceId(spaceId))

const dashboard = await this.qb
const trx = this.txContext.getCurrentTransaction()

const dashboard = await trx
.selectFrom("undb_dashboard")
.selectAll()
.$call((qb) => new DashboardReferenceVisitor(qb).call(spec))
.where((eb) => new DashboardFilterVisitor(eb, this.qb).$where(spec))
.where((eb) => new DashboardFilterVisitor(eb, trx).$where(spec))
.executeTakeFirst()

return dashboard ? Some(this.mapper.toDo(dashboard)) : None
4 changes: 2 additions & 2 deletions packages/persistence/src/db-client.ts
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ import { createClient } from "@libsql/client"
import { inject } from "@undb/di"
import Database from "bun:sqlite"

export const SQLITE_CLIENT = Symbol.for("SQLITE_CLIENT")
export const DATABASE_CLIENT = Symbol.for("DATABASE_CLIENT")

export const injectSqliteClient = () => inject(SQLITE_CLIENT)
export const injectDatabaseClient = () => inject(DATABASE_CLIENT)

export const createTursoClient = (url: string, authToken?: string) => {
return createClient({ url, authToken })
6 changes: 3 additions & 3 deletions packages/persistence/src/migrate.server.ts
Original file line number Diff line number Diff line change
@@ -6,12 +6,12 @@ import { drizzle as sqliteDrizzle } from "drizzle-orm/bun-sqlite"
import { migrate as sqliteMigrate } from "drizzle-orm/bun-sqlite/migrator"
import { drizzle as libsqlDrizzle } from "drizzle-orm/libsql"
import { migrate as libsqlMigrate } from "drizzle-orm/libsql/migrator"
import { SQLITE_CLIENT } from "./db-client"
import { DATABASE_CLIENT } from "./db-client"
import { DrizzleLogger } from "./db.logger"

export async function dbMigrate() {
if (env.UNDB_DB_PROVIDER === "sqlite" || !env.UNDB_DB_PROVIDER) {
const sqlite = container.resolve<Database>(SQLITE_CLIENT)
const sqlite = container.resolve<Database>(DATABASE_CLIENT)
const db = sqliteDrizzle(sqlite, {
logger: new DrizzleLogger(),
})
@@ -20,7 +20,7 @@ export async function dbMigrate() {
return
}

const sqlite = container.resolve<Client>(SQLITE_CLIENT)
const sqlite = container.resolve<Client>(DATABASE_CLIENT)
const db = libsqlDrizzle(sqlite, {
logger: new DrizzleLogger(),
})
2 changes: 1 addition & 1 deletion packages/persistence/src/server.ts
Original file line number Diff line number Diff line change
@@ -20,6 +20,6 @@ export * from "./webhook"
export { type Client } from "@libsql/client"
export * from "./ctx.interface"
export * from "./ctx.provider"
export { SQLITE_CLIENT, createSqliteClient, createTursoClient, injectSqliteClient } from "./db-client"
export { DATABASE_CLIENT, createSqliteClient, createTursoClient, injectDatabaseClient } from "./db-client"
export { injectQueryBuilder } from "./qb.provider"
export { type IQueryBuilder } from "./qb.type"
23 changes: 0 additions & 23 deletions packages/persistence/src/table/table-db.query-spec-handler.ts

This file was deleted.

9 changes: 9 additions & 0 deletions packages/persistence/src/table/table.filter-visitor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { Option } from "@undb/domain"
import type {
DuplicatedTableSpecification,
ITableSpecVisitor,
TableBaseIdSpecification,
TableComositeSpecification,
TableDo,
TableFormsSpecification,
TableIdSpecification,
@@ -53,6 +55,13 @@ export class TableFilterVisitor extends AbstractQBVisitor<TableDo> implements IT
this.addCond(this.eb.eb("undb_table.space_id", "=", spaceId))
}
}
$where(spec: Option<TableComositeSpecification>) {
if (spec.isSome()) {
spec.unwrap().accept(this)
}

return this.cond
}
withSpaceId(id: TableSpaceIdSpecification): void {
this.addCond(this.eb.eb("undb_table.space_id", "=", id.spaceId))
}
8 changes: 4 additions & 4 deletions packages/persistence/src/table/table.query-repository.ts
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import {
} from "@undb/table"
import { injectQueryBuilder } from "../qb.provider"
import type { IQueryBuilder } from "../qb.type"
import { TableDbQuerySpecHandler } from "./table-db.query-spec-handler"
import { TableFilterVisitor } from "./table.filter-visitor"
import { TableMapper } from "./table.mapper"
import { TableReferenceVisitor } from "./table.reference-visitor"

@@ -32,7 +32,7 @@ export class TableQueryRepository implements ITableQueryRepository {
.selectFrom("undb_table")
.selectAll()
.$if(spec.isSome(), (qb) => new TableReferenceVisitor(qb).call(spec.unwrap()))
.where((eb) => new TableDbQuerySpecHandler(this.qb, eb, this.context.mustGetCurrentSpaceId()).handle(spec))
.where((eb) => new TableFilterVisitor(this.qb, eb, this.context.mustGetCurrentSpaceId()).$where(spec))
.execute()

return tbs.map((r) => this.mapper.toDTO(r))
@@ -43,7 +43,7 @@ export class TableQueryRepository implements ITableQueryRepository {
.selectFrom("undb_table")
.selectAll()
.$call((qb) => new TableReferenceVisitor(qb).call(spec))
.where((eb) => new TableDbQuerySpecHandler(this.qb, eb, this.context.mustGetCurrentSpaceId()).handle(Some(spec)))
.where((eb) => new TableFilterVisitor(this.qb, eb, this.context.mustGetCurrentSpaceId()).$where(Some(spec)))
.executeTakeFirst()

return tb ? Some(this.mapper.toDTO(tb)) : None
@@ -55,7 +55,7 @@ export class TableQueryRepository implements ITableQueryRepository {
.selectFrom("undb_table")
.selectAll()
.$call((qb) => new TableReferenceVisitor(qb).call(spec.unwrap()))
.where((eb) => new TableDbQuerySpecHandler(this.qb, eb, this.context.mustGetCurrentSpaceId()).handle(spec))
.where((eb) => new TableFilterVisitor(this.qb, eb, this.context.mustGetCurrentSpaceId()).$where(spec))
.executeTakeFirst()

return tb ? Some(this.mapper.toDTO(tb)) : None
16 changes: 5 additions & 11 deletions packages/persistence/src/table/table.repository.ts
Original file line number Diff line number Diff line change
@@ -14,11 +14,9 @@ import {
import type { ITxContext } from "../ctx.interface"
import { injectTxCTX } from "../ctx.provider"
import type { InsertTable, InsertTableIdMapping } from "../db"
import { injectQueryBuilder } from "../qb.provider"
import type { IQueryBuilder } from "../qb.type"
import { json } from "../qb.util"
import { UnderlyingTableService } from "../underlying/underlying-table.service"
import { TableDbQuerySpecHandler } from "./table-db.query-spec-handler"
import { TableFilterVisitor } from "./table.filter-visitor"
import { TableMapper } from "./table.mapper"
import { TableMutationVisitor } from "./table.mutation-visitor"
import { TableReferenceVisitor } from "./table.reference-visitor"
@@ -30,8 +28,6 @@ export class TableRepository implements ITableRepository {
private readonly underlyingTableService: UnderlyingTableService,
@injectTableOutboxService()
private readonly outboxService: ITableOutboxService,
@injectQueryBuilder()
private readonly qb: IQueryBuilder,
@injectContext()
private readonly context: IContext,
@injectTxCTX()
@@ -179,9 +175,7 @@ export class TableRepository implements ITableRepository {
.selectFrom("undb_table")
.selectAll("undb_table")
.$if(spec.isSome(), (qb) => new TableReferenceVisitor(qb).call(spec.unwrap()))
.where((eb) =>
new TableDbQuerySpecHandler(tx, eb, this.context.mustGetCurrentSpaceId(), ignoreSpace).handle(spec),
)
.where((eb) => new TableFilterVisitor(tx, eb, this.context.mustGetCurrentSpaceId(), ignoreSpace).$where(spec))
const tbs = await query.execute()

return tbs.map((t) => this.mapper.toDo(t))
@@ -193,7 +187,7 @@ export class TableRepository implements ITableRepository {
.selectFrom("undb_table")
.selectAll("undb_table")
.$if(spec.isSome(), (qb) => new TableReferenceVisitor(qb).call(spec.unwrap()))
.where((eb) => new TableDbQuerySpecHandler(tx, eb, this.context.mustGetCurrentSpaceId()).handle(spec))
.where((eb) => new TableFilterVisitor(tx, eb, this.context.mustGetCurrentSpaceId()).$where(spec))
.executeTakeFirst()

if (!tb) {
@@ -210,7 +204,7 @@ export class TableRepository implements ITableRepository {
.selectFrom("undb_table")
.selectAll("undb_table")
.$call((qb) => new TableReferenceVisitor(qb).call(spec.unwrap()))
.where((eb) => new TableDbQuerySpecHandler(tx, eb, this.context.mustGetCurrentSpaceId()).handle(spec))
.where((eb) => new TableFilterVisitor(tx, eb, this.context.mustGetCurrentSpaceId()).$where(spec))
.executeTakeFirst()

return tb ? Some(this.mapper.toDo(tb)) : None
@@ -223,7 +217,7 @@ export class TableRepository implements ITableRepository {
.selectFrom("undb_table")
.selectAll("undb_table")
.$call((qb) => new TableReferenceVisitor(qb).call(spec.unwrap()))
.where((eb) => new TableDbQuerySpecHandler(tx, eb, this.context.mustGetCurrentSpaceId()).handle(spec))
.where((eb) => new TableFilterVisitor(tx, eb, this.context.mustGetCurrentSpaceId()).$where(spec))
.execute()

return tbs.map((t) => this.mapper.toDo(t))
4 changes: 0 additions & 4 deletions packages/persistence/src/webhook/webhook.repository.ts
Original file line number Diff line number Diff line change
@@ -4,8 +4,6 @@ import { None, Some, type Option } from "@undb/domain"
import { type IWebhookRepository, type WebhookDo, type WebhookSpecification } from "@undb/webhook"
import type { ITxContext } from "../ctx.interface"
import { injectTxCTX } from "../ctx.provider"
import { injectQueryBuilder } from "../qb.provider"
import type { IQueryBuilder } from "../qb.type"
import { WebhookFilterVisitor } from "./webhook.filter-visitor"
import { WebhookMapper } from "./webhook.mapper"
import { WebhookMutationVisitor } from "./webhook.mutation-visitor"
@@ -15,8 +13,6 @@ export class WebhookRepository implements IWebhookRepository {
constructor(
@inject(WebhookMapper)
private readonly mapper: WebhookMapper,
@injectQueryBuilder()
private readonly qb: IQueryBuilder,
@injectContext()
private readonly context: IContext,
@injectTxCTX()
2 changes: 1 addition & 1 deletion packages/table/package.json
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
"type": "module",
"devDependencies": {
"@types/bun": "latest",
"type-fest": "^4.31.0"
"type-fest": "^4.32.0"
},
"peerDependencies": {
"typescript": "^5.0.0"
2 changes: 1 addition & 1 deletion packages/zod/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"typescript": "^5.0.0"
},
"dependencies": {
"i18next": "^24.2.0",
"i18next": "^24.2.1",
"zod": "^3.24.1",
"zod-i18n-map": "^2.27.0",
"zod-validation-error": "^3.4.0"