sutandojs / sutando

Sutando is a modern Node.js ORM, like Laravel Eloquent.
https://sutando.org
MIT License
183 stars 15 forks source link

Insert and Delete missing from query builder in typescript #56

Closed Julius-Bendt closed 1 month ago

Julius-Bendt commented 1 month ago

Hi there! First of all - thanks for this package! I'm happy that something like eloquent exists for Node

Given the examples in https://sutando.org/guide/query-builder.html#insert-statements:

const db = sutando.connection();

await db.table('users').insert({
    email: 'kayla@example.com',
    votes: 0
});

const deleted = await db.table('users').where('votes', '>', 100).delete();

I get the following error: Property 'insert/delete' does not exist on type 'AnyQueryBuilder'.

I've tried to typecast as follows: const db = sutando.connection() as QueryBuilder<any, any>; but with the same result.

kiddyuchina commented 1 month ago

Thanks for the feedback. it has been resolved in v1.6.2.

Julius-Bendt commented 1 month ago

Thanks for the quick answer and fix! :D