Skip to content

Commit

Permalink
Deprecate public DAL methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-dp committed Jun 24, 2024
1 parent 692a12a commit 175d64b
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions clients/typescript/src/client/model/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ export class Table<
return includedTables
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
sync<T extends SyncInput<Include, Where>>(i?: T): Promise<ShapeSubscription> {
const validatedInput = this.syncSchema.parse(i ?? {})
const shape = computeShape(
Expand All @@ -221,6 +225,10 @@ export class Table<
* As such, one can compose these methods arbitrarily and then run them inside a single transaction.
*/

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
async create<T extends CreateInput<CreateData, Select, Include>>(
i: SelectSubset<T, CreateInput<CreateData, Select, Include>>
): Promise<Kind<GetPayload, T>> {
Expand All @@ -232,12 +240,20 @@ export class Table<
)
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
async createMany<T extends CreateManyInput<CreateData>>(
i: SelectSubset<T, CreateManyInput<CreateData>>
): Promise<BatchPayload> {
return this._executor.execute(this._createMany.bind(this, i))
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
async findUnique<T extends FindUniqueInput<Select, WhereUnique, Include>>(
i: SelectSubset<T, FindUniqueInput<Select, WhereUnique, Include>>
): Promise<Kind<GetPayload, T> | null> {
Expand All @@ -247,12 +263,20 @@ export class Table<
)
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
liveUnique<T extends FindUniqueInput<Select, WhereUnique, Include>>(
i: SelectSubset<T, FindUniqueInput<Select, WhereUnique, Include>>
): LiveResultContext<Kind<GetPayload, T> | null> {
return this.makeLiveResult(() => this.findUnique(i), i)
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
async findFirst<
T extends FindInput<Select, Where, Include, OrderBy, ScalarFieldEnum>
>(
Expand All @@ -267,6 +291,10 @@ export class Table<
)
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
liveFirst<
T extends FindInput<Select, Where, Include, OrderBy, ScalarFieldEnum>
>(
Expand All @@ -278,6 +306,10 @@ export class Table<
return this.makeLiveResult(() => this.findFirst(i), i ?? {})
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
async findMany<
T extends FindInput<Select, Where, Include, OrderBy, ScalarFieldEnum>
>(
Expand All @@ -292,6 +324,10 @@ export class Table<
)
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
liveMany<
T extends FindInput<Select, Where, Include, OrderBy, ScalarFieldEnum>
>(
Expand All @@ -303,6 +339,10 @@ export class Table<
return this.makeLiveResult(() => this.findMany(i), i ?? {})
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
async update<T extends UpdateInput<UpdateData, Select, WhereUnique, Include>>(
i: SelectSubset<T, UpdateInput<UpdateData, Select, WhereUnique, Include>>
): Promise<Kind<GetPayload, T>> {
Expand All @@ -311,12 +351,20 @@ export class Table<
)
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
async updateMany<T extends UpdateManyInput<UpdateData, Where>>(
i: SelectSubset<T, UpdateManyInput<UpdateData, Where>>
): Promise<BatchPayload> {
return this._executor.execute(this._updateMany.bind(this, i))
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
async upsert<
T extends UpsertInput<CreateData, UpdateData, Select, WhereUnique, Include>
>(
Expand All @@ -330,6 +378,10 @@ export class Table<
)
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
async delete<T extends DeleteInput<Select, WhereUnique, Include>>(
i: SelectSubset<T, DeleteInput<Select, WhereUnique, Include>>
): Promise<Kind<GetPayload, T>> {
Expand All @@ -338,6 +390,10 @@ export class Table<
)
}

/**
* @deprecated The DAL is deprecated and will be removed in a future release.
* You can use the raw query API or a query builder/ORM integration.
*/
async deleteMany<T extends DeleteManyInput<Where>>(
i?: SelectSubset<T, DeleteManyInput<Where>>
): Promise<BatchPayload> {
Expand Down

0 comments on commit 175d64b

Please sign in to comment.