| OLD | NEW |
| 1 # 2010 November 30 | 1 # 2010 November 30 |
| 2 # | 2 # |
| 3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
| 4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
| 5 # | 5 # |
| 6 # May you do good and not evil. | 6 # May you do good and not evil. |
| 7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
| 8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
| 9 # | 9 # |
| 10 #*********************************************************************** | 10 #*********************************************************************** |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 CREATE VIEW aux.v1 AS SELECT * FROM t1; | 38 CREATE VIEW aux.v1 AS SELECT * FROM t1; |
| 39 CREATE VIEW aux.v2 AS SELECT * FROM t1; | 39 CREATE VIEW aux.v2 AS SELECT * FROM t1; |
| 40 CREATE VIEW aux.v3 AS SELECT * FROM t1; | 40 CREATE VIEW aux.v3 AS SELECT * FROM t1; |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 proc list_all_views {{db db}} { | 44 proc list_all_views {{db db}} { |
| 45 set res [list] | 45 set res [list] |
| 46 $db eval { PRAGMA database_list } { | 46 $db eval { PRAGMA database_list } { |
| 47 set tbl "$name.sqlite_master" | 47 set tbl "$name.sqlite_master" |
| 48 if {$name == "temp"} { set tbl sqlite_temp_master } | 48 if {$name == "temp"} { set tbl temp.sqlite_master } |
| 49 | 49 |
| 50 set sql "SELECT '$name.' || name FROM $tbl WHERE type = 'view'" | 50 set sql "SELECT '$name.' || name FROM $tbl WHERE type = 'view'" |
| 51 lappend res {*}[$db eval $sql] | 51 lappend res {*}[$db eval $sql] |
| 52 } | 52 } |
| 53 set res | 53 set res |
| 54 } | 54 } |
| 55 | 55 |
| 56 proc list_all_data {{db db}} { | 56 proc list_all_data {{db db}} { |
| 57 set res [list] | 57 set res [list] |
| 58 $db eval { PRAGMA database_list } { | 58 $db eval { PRAGMA database_list } { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 } { | 183 } { |
| 184 1 "DROP VIEW IF EXISTS xx" 1 | 184 1 "DROP VIEW IF EXISTS xx" 1 |
| 185 2 "DROP VIEW IF EXISTS main.xx" 1 | 185 2 "DROP VIEW IF EXISTS main.xx" 1 |
| 186 3 "DROP VIEW IF EXISTS temp.v2" 1 | 186 3 "DROP VIEW IF EXISTS temp.v2" 1 |
| 187 } | 187 } |
| 188 | 188 |
| 189 | 189 |
| 190 | 190 |
| 191 | 191 |
| 192 finish_test | 192 finish_test |
| OLD | NEW |