Alec Larson

Results 479 comments of Alec Larson

> We can't just let `db.get` take an array of keys, because we want to support array-based keys. Now that we have runtime type information for columns, this isn't a...

### Database extensions Any module in a plugin package's `dist/database` folder is read during `tusken generate` command. These modules are bundled and seamlessly plugged into the generated client. Private instance...

## Partial plugins In your Tusken config, you can specify which extensions of a plugin you wish to use: ```ts export default defineConfig({ include: [ // The default if a...

Marking this as low priority, since #14 covers the most poignant use cases.

Would it make more sense to have `.as` be required and make the schema object as its 2nd argument? ```ts pg.json_to_record({ a: 1, b: '' }).as('row', { a: t.int, b:...

And of course, `json_to_record` should accept a string too. If passed an object, `JSON.stringify` is used implicitly. ```ts pg.json_to_record('{ "a": 1, "b": "" }').as('row', { a: t.int, b: t.text })...

Similarly, do the same for `json_to_recordset`. ```ts pg.json_to_recordset([{ a: 1, b: '' }, ...]).as('row', { a: t.int, b: t.text }) ``` …and the `jsonb` variants

Tusken can actually support both `pg` and `postgres`. Just need to detect which one is installed and generate a different client based on that.

🤔 https://github.com/gajus/postgres-bridge

We'll probably add a `groupBy` helper function for use in the selector function. ```ts db.select(t.user(user => [ groupBy(user.id), pg.avg(user.followerCount), ])) ```