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

"cannot infer the type of the placeholder" #56

Open
dawkot opened this issue Jun 12, 2020 · 0 comments
Open

"cannot infer the type of the placeholder" #56

dawkot opened this issue Jun 12, 2020 · 0 comments

Comments

@dawkot
Copy link

dawkot commented Jun 12, 2020

Basically this code errors at compile-time, and I don't know why:

let categoryName = "Cars"

let s = query:
  select product(name, img, price)
  join prod_cat(prod, cat) on product.id == prod_cat.prod
  join category(name) on category.id == prod_cat.cat
  where category.name == ?categoryName # cannot infer the type of the placeholder

This is the sqlite model:

create table product(
  id integer primary key,
  name varchar not null,
  img varchar not null,
  price integer not null,
  views integer not null default 0,
  created timestamp not null default (DATETIME('now')),
  modified timestamp not null default (DATETIME('now')));

create table category(
  id integer primary key,
  name varchar not null,
  img varchar not null);

create table prod_cat(
  prod integer not null references product(id),
  cat integer not null references category(id));
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