Question

What I have:

I have an SQLite database with connections. Here is a little part of the sql create code (A many-to-many connection between destinations and log_entries table):

DROP TABLE IF EXISTS "destinations";
CREATE TABLE "destinations" (
"ID_destination" INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL  UNIQUE , "name" VARCHAR NOT      NULL , "time_period" INTEGER NOT NULL , "details" TEXT
 );

DROP TABLE IF EXISTS "log_entries_destinations";
CREATE TABLE "log_entries_destinations" (
"ID_log_entries_destinations" INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL  UNIQUE ,     "ID_destination" INTEGER NOT NULL , "ID_log_entry" INTEGER NOT NULL
,FOREIGN KEY(ID_log_entry) REFERENCES log_entries(ID_log_entry)
,FOREIGN KEY(ID_destination) REFERENCES destinations(ID_destination)
);


DROP TABLE IF EXISTS "log_entries";
CREATE TABLE "log_entries" (
"ID_log_entry" INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL  UNIQUE , "timestamp"    DATETIME NOT NULL
);

You can see, I have defined the relationships with foreign keys.

For the db in the Firefox Addin, SQLite Manager I have setted in "On-connect SQL" tab the following key: *PRAGMA foreign_keys=ON;*

What is my problem: Because I am not so good in complex SQL query writing, I have to design queries in graphic tool. My decision was the SQuirreL. I have downloaded the JDBC driver for SQLite.

In SQuirreL when I send all of the tables to the graph, I can't see the're relations. On Query Builder tool too. Has anybody experience with SQLite-Squirrel combo? Exists any alternative query designer tool for sqlite? Or the simplest way is run the SQL creator script in Access for example, and design queries there?

Was it helpful?

Solution

I would suggest not using a query builder tool; it will be a lot easier for you in the long run if you bite the bullet now and struggle writing your first one or two queries... you'll quickly get the hang of it.

The alternative would be forever trying to get your query builder tool to do precisely what you want it to... which can be a real headache.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top