# HG changeset patch # User Catherine Devlin # Date 1288665109 14400 # Node ID 1feb3395744313b4bf2d1eb43c9e74bc04bdfbc3 # Parent 17f5d69307a913a666024d1ec6d3006d97ac2807 new sakila mysql tests diff -r 17f5d69307a9 -r 1feb33957443 setup.py --- a/setup.py Mon Nov 01 12:22:34 2010 -0400 +++ b/setup.py Mon Nov 01 22:31:49 2010 -0400 @@ -22,7 +22,7 @@ url="http://packages.python.org/sqlpython", packages=find_packages(), include_package_data=True, - install_requires=['pyparsing','cmd2>=0.6.1','gerald>=0.4.1', + install_requires=['pyparsing','cmd2>=0.6.1','gerald>=0.4.1.1', 'genshi>=0.5'], extras_require = { 'oracle': ['cx_Oracle>=5.0.2'], diff -r 17f5d69307a9 -r 1feb33957443 sqlpython/sakila-test.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sqlpython/sakila-test.txt Mon Nov 01 22:31:49 2010 -0400 @@ -0,0 +1,140 @@ +""" +Run these against a ``sakila`` database (user sakila, password sakila) +""" + +SQL.No_Connection> connect mysql://sakila:sakila@localhost/sakila +0:sakila@sakila> set color off +colors - was: True +now: False +0:sakila@sakila> desc actor +BASE TABLE sakila.actor +Name Nullable Type +----------- -------- ----------- +actor_id NOT NULL smallint +first_name NOT NULL varchar(45) +last_name NOT NULL varchar(45) +last_update NOT NULL timestamp + +0:sakila@sakila> desc actor\g +BASE TABLE sakila.actor + + +**** Row: 1 +Name: actor_id +Nullable: NOT NULL +Type: smallint + +**** Row: 2 +Name: first_name +Nullable: NOT NULL +Type: varchar(45) + +**** Row: 3 +Name: last_name +Nullable: NOT NULL +Type: varchar(45) + +**** Row: 4 +Name: last_update +Nullable: NOT NULL +Type: timestamp + + +0:sakila@sakila> \d -l actor\g +BASE TABLE sakila.actor + + +**** Row: 1 +N: 1 +Name: actor_id +Nullable: NOT NULL +Type: smallint +Key: P +Default: +Comments: + +**** Row: 2 +N: 2 +Name: first_name +Nullable: NOT NULL +Type: varchar(45) +Key: +Default: +Comments: + +**** Row: 3 +N: 3 +Name: last_name +Nullable: NOT NULL +Type: varchar(45) +Key: +Default: +Comments: + +**** Row: 4 +N: 4 +Name: last_update +Nullable: NOT NULL +Type: timestamp +Key: +Default: +Comments: + + +0:sakila@sakila> show constraints on actor +Constraints on BASE TABLE sakila.actor +Primary key "PRIMARY": (actor_id) +0:sakila@sakila> show indexes on actor +Indexes on BASE TABLE sakila.actor +idx_actor_last_name (last_name) BTREE +0:sakila@sakila> select actor_id, first_name, last_name from actor\j3 + + +{"actor": [ + {"actor_id": 1, "first_name": "PENELOPE", "last_name": "GUINESS"}, + {"actor_id": 2, "first_name": "NICK", "last_name": "WAHLBERG"}, + {"actor_id": 3, "first_name": "ED", "last_name": "CHASE"} + ] +} + +3 rows selected. + +0:sakila@sakila> set wild on +wildsql - was: False +now: True +0:sakila@sakila> select #1, #2, #3 from actor;3 + +actor_id first_name last_name +-------- ---------- --------- +1 PENELOPE GUINESS +2 NICK WAHLBERG +3 ED CHASE + +3 rows selected. + +0:sakila@sakila> select !#4 from actor;3 + +actor_id first_name last_name +-------- ---------- --------- +1 PENELOPE GUINESS +2 NICK WAHLBERG +3 ED CHASE + +3 rows selected. + +0:sakila@sakila> select *name from actor;3 + +first_name last_name +---------- --------- +PENELOPE GUINESS +NICK WAHLBERG +ED CHASE + +3 rows selected. + +0:sakila@sakila> show constraint on film_actor; +Constraints on BASE TABLE sakila.film_actor +Foreign key "fk_film_actor_actor": columns (actor_id) in table "actor" +Foreign key "fk_film_actor_film": columns (film_id) in table "film" +Primary key "PRIMARY": (actor_id,film_id) +0:sakila@sakila> \ No newline at end of file