--- a/src/test/scala/Test.scala Fri Oct 15 10:24:49 2010 -0400
+++ b/src/test/scala/Test.scala Fri Oct 29 14:59:33 2010 -0400
@@ -16,9 +16,9 @@
test("2 People 1 Addresses") {
val addrs = Relation("Addresses",
- Header("ID" -> SQLInt(),
- "city" -> SQLString(),
- "state" -> SQLString()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "city" -> RDB.Datatype.STRING,
+ "state" -> RDB.Datatype.STRING),
List(Tuple("ID" -> LexicalValue("18"),
"city" -> LexicalValue("Cambridge"),
"state" -> LexicalValue("MA"))),
@@ -27,9 +27,9 @@
ForeignKeys())
val people = Relation("People",
- Header("ID" -> SQLInt(),
- "fname" -> SQLString(),
- "addr" -> SQLInt()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "fname" -> RDB.Datatype.STRING,
+ "addr" -> RDB.Datatype.INTEGER),
List(Tuple("ID" -> LexicalValue("7"),
"fname" -> LexicalValue("Bob"),
"addr" -> LexicalValue("18")),
@@ -62,9 +62,9 @@
test("2 People 1 Addresses 1 Department") {
val addrs = Relation("Addresses",
- Header("ID" -> SQLInt(),
- "city" -> SQLString(),
- "state" -> SQLString()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "city" -> RDB.Datatype.STRING,
+ "state" -> RDB.Datatype.STRING),
List(Tuple("ID" -> LexicalValue("18"),
"city" -> LexicalValue("Cambridge"),
"state" -> LexicalValue("MA"))),
@@ -73,11 +73,11 @@
ForeignKeys())
val people = Relation("People",
- Header("ID" -> SQLInt(),
- "fname" -> SQLString(),
- "addr" -> SQLInt(),
- "deptName" -> SQLString(),
- "deptCity" -> SQLString()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "fname" -> RDB.Datatype.STRING,
+ "addr" -> RDB.Datatype.INTEGER,
+ "deptName" -> RDB.Datatype.STRING,
+ "deptCity" -> RDB.Datatype.STRING),
List(Tuple("ID" -> LexicalValue("7"),
"fname" -> LexicalValue("Bob"),
"addr" -> LexicalValue("18"),
@@ -94,10 +94,10 @@
List("deptName", "deptCity") -> Target("Department", CandidateKey("name", "city"))))
val department = Relation("Department",
- Header("ID" -> SQLInt(),
- "name" -> SQLString(),
- "city" -> SQLString(),
- "manager" -> SQLInt()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "name" -> RDB.Datatype.STRING,
+ "city" -> RDB.Datatype.STRING,
+ "manager" -> RDB.Datatype.INTEGER),
List(Tuple("ID" -> LexicalValue("23"),
"name" -> LexicalValue("accounting"),
"city" -> LexicalValue("Cambridge"),
@@ -138,9 +138,9 @@
test("2 People 1 Addresses 1 Department 2 Projects 1 Task") {
val addrs = Relation("Addresses",
- Header("ID" -> SQLInt(),
- "city" -> SQLString(),
- "state" -> SQLString()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "city" -> RDB.Datatype.STRING,
+ "state" -> RDB.Datatype.STRING),
List(Tuple("ID" -> LexicalValue("18"),
"city" -> LexicalValue("Cambridge"),
"state" -> LexicalValue("MA"))),
@@ -149,11 +149,11 @@
ForeignKeys())
val people = Relation("People",
- Header("ID" -> SQLInt(),
- "fname" -> SQLString(),
- "addr" -> SQLInt(),
- "deptName" -> SQLString(),
- "deptCity" -> SQLString()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "fname" -> RDB.Datatype.STRING,
+ "addr" -> RDB.Datatype.INTEGER,
+ "deptName" -> RDB.Datatype.STRING,
+ "deptCity" -> RDB.Datatype.STRING),
List(Tuple("ID" -> LexicalValue("7"),
"fname" -> LexicalValue("Bob"),
"addr" -> LexicalValue("18"),
@@ -170,10 +170,10 @@
List("deptName", "deptCity") -> Target("Department", CandidateKey("name", "city"))))
val department = Relation("Department",
- Header("ID" -> SQLInt(),
- "name" -> SQLString(),
- "city" -> SQLString(),
- "manager" -> SQLInt()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "name" -> RDB.Datatype.STRING,
+ "city" -> RDB.Datatype.STRING,
+ "manager" -> RDB.Datatype.INTEGER),
List(Tuple("ID" -> LexicalValue("23"),
"name" -> LexicalValue("accounting"),
"city" -> LexicalValue("Cambridge"),
@@ -184,10 +184,10 @@
ForeignKeys(List("manager") -> Target("People", CandidateKey("ID"))))
val projects = Relation("Projects",
- Header("lead" -> SQLInt(),
- "name" -> SQLString(),
- "deptName" -> SQLString(),
- "deptCity" -> SQLString()),
+ Header("lead" -> RDB.Datatype.INTEGER,
+ "name" -> RDB.Datatype.STRING,
+ "deptName" -> RDB.Datatype.STRING,
+ "deptCity" -> RDB.Datatype.STRING),
List(Tuple("lead" -> LexicalValue("8"),
"name" -> LexicalValue("pencil survey"),
"deptName" -> LexicalValue("accounting"),
@@ -205,10 +205,10 @@
List("deptName", "deptCity") -> Target("Department", CandidateKey("name", "city"))))
val tasks = Relation("TaskAssignments",
- Header("worker" -> SQLInt(),
- "project" -> SQLString(),
- "deptName" -> SQLString(),
- "deptCity" -> SQLString()),
+ Header("worker" -> RDB.Datatype.INTEGER,
+ "project" -> RDB.Datatype.STRING,
+ "deptName" -> RDB.Datatype.STRING,
+ "deptCity" -> RDB.Datatype.STRING),
List(Tuple("worker" -> LexicalValue("7"),
"project" -> LexicalValue("pencil survey"),
"deptName" -> LexicalValue("accounting"),
@@ -269,9 +269,9 @@
test("1 People 1 Addresses 1 Offices") {
val addrs = Relation("Addresses",
- Header("ID" -> SQLInt(),
- "city" -> SQLString(),
- "state" -> SQLString()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "city" -> RDB.Datatype.STRING,
+ "state" -> RDB.Datatype.STRING),
List(Tuple("ID" -> LexicalValue("18"),
"city" -> LexicalValue("Cambridge"),
"state" -> LexicalValue("MA"))),
@@ -280,9 +280,9 @@
ForeignKeys())
val people = Relation("People",
- Header("ID" -> SQLInt(),
- "fname" -> SQLString(),
- "addr" -> SQLInt()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "fname" -> RDB.Datatype.STRING,
+ "addr" -> RDB.Datatype.INTEGER),
List(Tuple("ID" -> LexicalValue("7"),
"fname" -> LexicalValue("Bob"),
"addr" -> LexicalValue("18"))),
@@ -291,9 +291,9 @@
ForeignKeys(List("addr") -> Target("Addresses", CandidateKey("ID"))))
val offices = Relation("Offices",
- Header("ID" -> SQLInt(),
- "building" -> SQLInt(),
- "ofcNumber" -> SQLString()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "building" -> RDB.Datatype.INTEGER,
+ "ofcNumber" -> RDB.Datatype.STRING),
List(Tuple("ID" -> LexicalValue("18"),
"building" -> LexicalValue("32"),
"ofcNumber" -> LexicalValue("G528"))),
@@ -325,9 +325,9 @@
test("1 People 1 Addresses 1 Offices 1 ExectutiveOffices") {
val addrs = Relation("Addresses",
- Header("ID" -> SQLInt(),
- "city" -> SQLString(),
- "state" -> SQLString()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "city" -> RDB.Datatype.STRING,
+ "state" -> RDB.Datatype.STRING),
List(Tuple("ID" -> LexicalValue("18"),
"city" -> LexicalValue("Cambridge"),
"state" -> LexicalValue("MA"))),
@@ -336,9 +336,9 @@
ForeignKeys())
val people = Relation("People",
- Header("ID" -> SQLInt(),
- "fname" -> SQLString(),
- "addr" -> SQLInt()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "fname" -> RDB.Datatype.STRING,
+ "addr" -> RDB.Datatype.INTEGER),
List(Tuple("ID" -> LexicalValue("7"),
"fname" -> LexicalValue("Bob"),
"addr" -> LexicalValue("18"))),
@@ -347,9 +347,9 @@
ForeignKeys(List("addr") -> Target("Addresses", CandidateKey("ID"))))
val offices = Relation("Offices",
- Header("ID" -> SQLInt(),
- "building" -> SQLInt(),
- "ofcNumber" -> SQLString()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "building" -> RDB.Datatype.INTEGER,
+ "ofcNumber" -> RDB.Datatype.STRING),
List(Tuple("ID" -> LexicalValue("18"),
"building" -> LexicalValue("32"),
"ofcNumber" -> LexicalValue("G528"))),
@@ -358,8 +358,8 @@
ForeignKeys(List("ID") -> Target("Addresses", CandidateKey("ID"))))
val execoffices = Relation("ExecutiveOffices",
- Header("ID" -> SQLInt(),
- "desk" -> SQLString()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "desk" -> RDB.Datatype.STRING),
List(Tuple("ID" -> LexicalValue("18"),
"desk" -> LexicalValue("oak"))),
List(CandidateKey("ID")),
@@ -417,9 +417,9 @@
test("2 Employees") {
val employees = Relation("Employees",
- Header("ID" -> SQLInt(),
- "fname" -> SQLString(),
- "boss" -> SQLInt()),
+ Header("ID" -> RDB.Datatype.INTEGER,
+ "fname" -> RDB.Datatype.STRING,
+ "boss" -> RDB.Datatype.INTEGER),
List(Tuple("ID" -> LexicalValue("1"),
"fname" -> LexicalValue("Alice"),
"boss" -> ␀()),