# File: test.coffee

Defined in: | .

## Variables Summary

OUTLAW_DDL =

      'CREATE TABLE OUTLAW ( ID              INT, NAME            TEXT, AKA             TEXT, GANG            INT, BIRTH_DATE      DATE, DEATH_DATE      DATE, HANDEDNESS      INT )'

OUTLAW_DML =

      ['INSERT INTO OUTLAW (ID, NAME, AKA, GANG, BIRTH_DATE, DEATH_DATE, HANDEDNESS) VALUES (10, "Henry McCarty", "Billy the Kid", 10, "1859.September.17","1881.July.14",10)', 'INSERT INTO OUTLAW (ID, NAME, AKA, GANG, BIRTH_DATE, DEATH_DATE, HANDEDNESS) VALUES (20, "Josiah Gordon Scurlock", "Doc", 10, "1849.January.11","1929.July.25",20)', 'INSERT INTO OUTLAW (ID, NAME, AKA, GANG, BIRTH_DATE, DEATH_DATE, HANDEDNESS) VALUES (30, "Jesse Woodson James", "Jesse James", 20, "1847.September.05","1882.April.03",20)', 'INSERT INTO OUTLAW (ID, NAME, AKA, GANG, BIRTH_DATE, DEATH_DATE, HANDEDNESS) VALUES (40, "Alexander Franklin James", "Frank", 20, "1843.January.10","1915.February.18",20)', 'INSERT INTO OUTLAW (ID, NAME, AKA, GANG, BIRTH_DATE, DEATH_DATE, HANDEDNESS) VALUES (50,"Harry Alonzo Longabaugh","Sundance Kid",30, "1867.July.17","1908.November.07",30)', 'INSERT INTO OUTLAW (ID, NAME, AKA, GANG, BIRTH_DATE, DEATH_DATE, HANDEDNESS) VALUES (60,"Robert Leroy Parker","Butch Cassidy",30, "1867.July.17","1908.November.07",30)', 'INSERT INTO OUTLAW (ID, NAME, AKA, GANG, BIRTH_DATE, DEATH_DATE, HANDEDNESS) VALUES (70,"John Wesley Hardin","Little Arkansaw",40, "1853.May.26","1895.Agust.19",40)']

GANG_DDL =

      'CREATE TABLE GANG ( ID      INT, NAME    TEXT, LEADER  INT )'

GANG_DML =

      ['INSERT INTO GANG (ID,NAME, LEADER) VALUES (10,"Regulators",10)', 'INSERT INTO GANG (ID,NAME, LEADER) VALUES (20,"James-Younger",30)', 'INSERT INTO GANG (ID,NAME, LEADER) VALUES (30,"Wild Bunch",60)', 'INSERT INTO GANG (ID,NAME, LEADER) VALUES (40,"Hardin Gang",70)']

HANDEDNESS_DDL =

      'CREATE TABLE HANDEDNESS ( ID      INT, NAME    TEXT, DESC    TEXT )'

HANDEDNESS_DML =

      ['INSERT INTO HANDEDNESS (ID, NAME, DESC) VALUES (10, "Left Handed",  "Uses left hand primarily")', 'INSERT INTO HANDEDNESS (ID, NAME, DESC) VALUES (20, "Right Handed", "Uses right hand primarily")', 'INSERT INTO HANDEDNESS (ID, NAME, DESC) VALUES (30, "Mixed Handed", "Uses one or the other hand for different tasks")', 'INSERT INTO HANDEDNESS (ID, NAME, DESC) VALUES (40, "Ambidextrous", "Uses both hands equally.")']

ddls =

      [OUTLAW_DDL, GANG_DDL, HANDEDNESS_DDL]

dmls =

      [OUTLAW_DML, GANG_DML, HANDEDNESS_DML]

tables =

      ['OUTLAW', 'GANG', 'HANDEDNESS']

config =

      {
        libs: ['test/lib/sqlite-jdbc-3.8.11.2.jar'],
        className: 'org.sqlite.JDBC',
        url: 'jdbc:sqlite:test.db'
      }

config =

      {
        libs: ['test/lib/ojdbc7.jar'],
        className: 'oracle.jdbc.driver.OracleDriver',
        url: 'jdbc:oracle:thin:@//win:1521/orcl',
        username: 'demo',
        password: 'demo'
      }

## Method Summary

- ~ (?) dropClean() Drops all _DDL tables.
- ~ (?) deleteClean() Deletes all the records from the tables in our Outlaw DB.
- ~ (?) create() executes CREATE ddl statements.
- ~ (?) load() Inserts records to tables.
- ~ (Object) read() executes a sample select statement and returns all the records as a json object

## Method Details

~ (?) dropClean()

Drops all _DDL tables. This method throws TableNotFound exception if the tables do not exist in database.

successfully

### Returns:

- ( `?` ) — returns a promise when all the tables are dropped

~ (?) deleteClean()

TODO: We can also return number of records deleted for each statement.

Deletes all the records from the tables in our Outlaw DB.

### Returns:

- ( `?` ) — returns a promise when all the DELETE statements are fulfilled.

~ (?) create()

executes CREATE ddl statements.

### Returns:

- ( `?` ) — returns a promise when all the CREATE statements are fulfilled.

~ (?) load()

Inserts records to tables.

### Returns:

- ( `?` ) — returns a promise when all the CREATE statements are fulfilled.

~ (Object) read()

executes a sample select statement and returns all the records as a json object

### Returns:

- ( `Object` ) — result all records returned by the sample SQL query

Quickly fuzzy find classes, mixins, methods, file:

- T Open fuzzy finder dialog

Control the navigation frame:

- L Toggle list view
- C Show class list
- I Show mixin list
- F Show file list
- M Show method list
- E Show extras list

You can focus and blur the search input:

- S Focus search input
- Esc Blur search input