Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions pg_upgrade_internal.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

-----------------------------------------------------------------
pg_upgrade run on Wed Jun 6 17:54:55 2018
-----------------------------------------------------------------

check for "/usr/local/Cellar/postgresql@9.6/9.6.5/bin" failed: No such file or directory


-----------------------------------------------------------------
pg_upgrade run on Wed Jun 6 17:55:11 2018
-----------------------------------------------------------------

check for "/usr/local/Cellar/postgresql@9.6/9.6.5/bin" failed: No such file or directory

10 changes: 10 additions & 0 deletions pg_upgrade_server.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

-----------------------------------------------------------------
pg_upgrade run on Wed Jun 6 17:54:55 2018
-----------------------------------------------------------------


-----------------------------------------------------------------
pg_upgrade run on Wed Jun 6 17:55:11 2018
-----------------------------------------------------------------

10 changes: 10 additions & 0 deletions pg_upgrade_utility.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

-----------------------------------------------------------------
pg_upgrade run on Wed Jun 6 17:54:55 2018
-----------------------------------------------------------------


-----------------------------------------------------------------
pg_upgrade run on Wed Jun 6 17:55:11 2018
-----------------------------------------------------------------

51 changes: 51 additions & 0 deletions queries.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
PRAGMA foreign_keys = ON; -- SQLITE ONLY!

DROP TABLE IF EXISTS player;
DROP TABLE IF EXISTS room;

CREATE TABLE player (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(128) NOT NULL, -- It cannot be empty!
room_id INTEGER REFERENCES room(id) -- FOREIGN KEY
);

CREATE TABLE object (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(128) NOT NULL
);

CREATE TABLE room (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(128) NOT NULL,
description VARCHAR(1024),
w_to INTEGER REFERENCES room(id),
e_to INTEGER REFERENCES room(id),
s_to INTEGER REFERENCES room(id),
n_to INTEGER REFERENCES room(id)
);

CREATE TABLE room_object (
room_id INTEGER REFERENCES room(id),
object_id INTEGER REFERENCES object(id)
);

INSERT INTO room (name, description) VALUES ("Foyer", "This is where the adventure begins!");
INSERT INTO room (name, description) VALUES ("Hallway", "Between the foyer and the rest of the house!");

UPDATE room SET n_to=2 WHERE id=1;
UPDATE room SET n_to=1 WHERE id=2;

INSERT INTO player (name, room_id) values ("Beej", 1);

INSERT INTO object (name) VALUES ("Plastic shield");

INSERT INTO room_object (room_id, object_id) VALUES (1,1); --Sword in the foyer
INSERT INTO room_object (room_id, object_id) VALUES (2,1); --Sword in the Hallway
INSERT INTO room_object (room_id, object_id) VALUES (2,2); --Shield in the Hallway

SELECT name FROM player;
SELECT room_id FROM player;

SELECT player.name AS "Player Name", room.name, description FROM player, room
WHERE player.room_id = room.id AND -- This is the joining part.
player.id = 1;
2 changes: 2 additions & 0 deletions sqliterc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.header on
.mode column