Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Commit f4d0967

Browse files
committed
added specs for create table, constraints, joins, select parts, transactions, unions, triggers, etc... refs #2
1 parent f44b86c commit f4d0967

22 files changed

+213
-7
lines changed

test/index-spec.js

Lines changed: 111 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/sql/basicDropTrigger.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP TRIGGER IF EXISTS `happy`.`insertRecord`

test/sql/basicFunction.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SELECT COUNT(*), MAX(price)
2+
FROM apples

test/sql/basicSubquery.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SELECT a.color
2+
FROM (
3+
SELECT b.color
4+
FROM bananas b
5+
) z JOIN apples a
6+
ON a.color = b.color

test/sql/basicUnion.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SELECT *
2+
FROM a
3+
UNION
4+
SELECT *
5+
FROM b

test/sql/createCheck1.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CREATE TABLE Bees (
2+
id int PRIMARY KEY,
3+
name varchar(50) NOT NULL UNIQUE,
4+
wings int CHECK(wings >= 2),
5+
legs int CHECK (legs < 8)
6+
);

test/sql/createCheck2.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CREATE TABLE Bees (
2+
id int PRIMARY KEY,
3+
name varchar(50) NOT NULL UNIQUE,
4+
wings int,
5+
legs int,
6+
CHECK (legs < 8),
7+
CHECK(wings >= 2)
8+
);

test/sql/createForeignKey1.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CREATE TABLE Bees (
2+
id int PRIMARY KEY,
3+
color int,
4+
hive_id int UNIQUE,
5+
FOREIGN KEY (hive_id) REFERENCES Hives
6+
);

test/sql/createForeignKey2.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CREATE TABLE Bees (
2+
id int PRIMARY KEY,
3+
color int,
4+
hive_id int UNIQUE REFERENCES Hives(id)
5+
);

0 commit comments

Comments
 (0)