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

pg-typed and & or TypeScript error if WhereConditions have different shapes #326

Open
spiffytech opened this issue Jun 13, 2024 · 0 comments

Comments

@spiffytech
Copy link

When using and and or, I get a TypeScript error if I supply different columns to the different WhereConditions.

      const link = await tables.links(db).findOne(
        or(
          { user_id: user.user_id, original_url: query.originalUrl },
          { user_id: user.user_id, url: query.url },
        ),
      );
Object literal may only specify known properties, and 'url' does not exist in type 
'WhereCondition<{ user_id: string & { readonly __brand?: "users_user_id" | undefined; }; original_url: string; }>'.ts(2353)
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

No branches or pull requests

1 participant