Skip to content

Update knex #3

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Update knex #3

wants to merge 3 commits into from

Conversation

raychan
Copy link
Collaborator

@raychan raychan commented Jul 28, 2017

No description provided.

declare class Knex$Knex mixins Knex$QueryBuilder, Promise, events$EventEmitter {
static (config: Knex$Config): Knex$Knex,
declare class Knex$Knex<T> mixins Knex$QueryBuilder<T>, Promise, events$EventEmitter {
static (config: Knex$Config): Knex$Knex<T>,
Copy link

@briancavalier briancavalier Jul 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, this all seems very tricky. There are at least a couple things I think we need to consider:

  1. We don't want to over-constrain the type parameter of Knex$Knex, since we'd like it to represent the whole database, which could contain many tables (yelp-gil-service's db is an outlier with only 1 table).
  2. Joins seem especially tricky, since they are a single operation, e.g. innerJoin that involves at least 2 types--one for each table involved in the join. They may even involve 3 types--one for each table, plus one for the result type if the two tables are joined in a projection (i.e. a subset of fields from each table). Sometimes that 3rd type might be a proper intersection of the two other types, but not always.

I have some ideas, but nothing concrete yet ... let's talk about it tomorrow if we have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants