SQuirreL SQL Client snapshot-20181209_2128
SQLite version: 3.25.2
Create the following structure. Product and customer are in a many-to-many relation, represented by the purchase table.
create table product(
id integer primary key,
name text not null,
price numeric(10,2)
);
create table customer (
id integer primary key,
name text not null,
size integer
);
create table purchase(
customer_id integer not null,
product_id integer not null,
primary key(customer_id, product_id),
foreign key(customer_id) references customer(id),
foreign key(product_id) references product(id)
);
Create a graph by adding all three tables to a new graph.
The foreign keys are presented wrongly, see screenshot.
Also, query builder does not function properly either: by choosing solely the customer.name, the following SQL is generated:
SELECT
customer.name
FROM customer
INNER JOIN purchase ON customer.id = purchase.customer_id
AND customer.id = purchase.product_id
expected would be just: SELECT customer.name FROM customer
Also, if only two tables are being added to the graph, the relation is being displayed correctly.