Lines Matching refs:db
43 set v [catch {db bogus} msg]
47 set v [catch {db cache bogus} msg]
51 set v [catch {db cache} msg]
53 } {1 {wrong # args: should be "db cache option ?arg?"}}
58 db eval {SELECT * FROM t1} data {
66 db eval {SELECT * FROM t2} data {
74 db eval {SELECT * FROM t1} data {
83 db eval {SELECT * FROM t1} data {
90 set v [catch {db} msg]
92 } {1 {wrong # args: should be "db SUBCOMMAND ..."}}
93 if {[catch {db auth {}}]==0} {
95 set v [catch {db authorizer 1 2 3} msg]
97 } {1 {wrong # args: should be "db authorizer ?CALLBACK?"}}
100 set v [catch {db busy 1 2 3} msg]
102 } {1 {wrong # args: should be "db busy CALLBACK"}}
104 set v [catch {db progress 1} msg]
106 } {1 {wrong # args: should be "db progress N CALLBACK"}}
108 set v [catch {db changes xyz} msg]
110 } {1 {wrong # args: should be "db changes "}}
112 set v [catch {db commit_hook a b c} msg]
114 } {1 {wrong # args: should be "db commit_hook ?CALLBACK?"}}
117 set v [catch {db complete} msg]
119 } {1 {wrong # args: should be "db complete SQL"}}
122 set v [catch {db eval} msg]
124 } {1 {wrong # args: should be "db eval ?OPTIONS? SQL ?ARRAY-NAME? ?SCRIPT?"}}
126 set v [catch {db function} msg]
128 } {1 {wrong # args: should be "db function NAME ?SWITCHES? SCRIPT"}}
130 set v [catch {db last_insert_rowid xyz} msg]
132 } {1 {wrong # args: should be "db last_insert_rowid "}}
134 set v [catch {db rekey} msg]
136 } {1 {wrong # args: should be "db rekey KEY"}}
138 set v [catch {db timeout} msg]
140 } {1 {wrong # args: should be "db timeout MILLISECONDS"}}
142 set v [catch {db collate} msg]
144 } {1 {wrong # args: should be "db collate NAME SCRIPT"}}
146 set v [catch {db collation_needed} msg]
148 } {1 {wrong # args: should be "db collation_needed SCRIPT"}}
150 set v [catch {db total_changes xyz} msg]
152 } {1 {wrong # args: should be "db total_changes "}}
154 set v [catch {db copy} msg]
156 } {1 {wrong # args: should be "db copy CONFLICT-ALGORITHM TABLE FILENAME ?SEPARATOR? ?NULLINDICATOR…
158 set v [catch {sqlite3 db2 test.db -vfs nosuchvfs} msg]
173 db eval "SELECT * FROM t\u0123x" result break
186 set rc [catch {db onecolumn {SELECT * FROM t1 ORDER BY a}} msg]
190 db onecolumn {SELECT * FROM t1 WHERE a<0}
193 set rc [catch {db onecolumn} errmsg]
195 } {1 {wrong # args: should be "db onecolumn SQL"}}
197 set rc [catch {db onecolumn {SELECT bogus}} errmsg]
203 set rc [catch {db one {SELECT * FROM t1 WHERE b>$b}} msg]
208 set rc [catch {db one {SELECT * FROM t1 WHERE b>$b}} msg]
213 set rc [catch {db one {
230 db busy busy_callback
231 db busy
234 db busy {}
235 db busy
262 db eval {
278 db eval {SELECT * FROM t1} {
285 db eval {SELECT * FROM t1} {
293 db eval {SELECT * FROM t1} {
301 db eval {SELECT * FROM t1} {
318 db version
325 db nullvalue NaN
327 db eval {SELECT * FROM t1 WHERE b IS NULL}
331 db function concat concatFunc
332 db eval {SELECT concat('a', b, 'z') FROM t1 WHERE b is NULL}
335 db nullvalue NULL
336 db nullvalue
339 db nullvalue {}
340 db eval {SELECT * FROM t1 WHERE b IS NULL}
343 db function concat concatFunc
344 db eval {SELECT concat('a', b, 'z') FROM t1 WHERE b is NULL}
350 db function ret_str {return "hi"}
354 db function ret_dbl {return [expr {rand()*0.5}]}
358 db function ret_int {return [expr {int(rand()*200)}]}
369 return [expr {[db eval {SELECT r1($nm1)}]+$n}]
371 db function r1 userfunc_r1
383 db transaction {}
386 db transaction deferred {}
389 db transaction immediate {}
392 db transaction exclusive {}
395 set rc [catch {db transaction xyzzy {}} msg]
399 set rc [catch {db transaction {error test-error}} msg]
403 db transaction {
404 db eval {CREATE TABLE t4(x)}
405 db transaction {
406 db eval {INSERT INTO t4 VALUES(1)}
409 db eval {SELECT * FROM t4}
413 db transaction {
414 db eval {INSERT INTO t4 VALUES(2)}
415 db eval {INSERT INTO t4 VALUES(3)}
416 db eval {INSERT INTO t4 VALUES(4)}
420 db eval {SELECT * FROM t4}
423 db transaction {
424 db eval {INSERT INTO t4 VALUES(2)}
426 db transaction {
427 db eval {INSERT INTO t4 VALUES(3)}
428 db eval {INSERT INTO t4 VALUES(4)}
433 db eval {SELECT * FROM t4}
437 db transaction {
438 db eval {INSERT INTO t4 VALUES(5)}
443 db eval {SELECT * FROM t4}
447 db transaction {
448 db eval {INSERT INTO t4 VALUES(6)}
452 db eval {SELECT * FROM t4}
457 db transaction {
458 db eval {INSERT INTO t4 VALUES(7)}
465 db eval {SELECT * FROM t4}
468 # Now test that [db transaction] commands may be nested with
472 db transaction {
473 db eval {
479 db transaction {
480 db eval { INSERT INTO t4 VALUES('two') }
481 db transaction {
482 db eval { INSERT INTO t4 VALUES('three') }
489 db eval {SELECT * FROM t4}
493 db eval {BEGIN ; COMMIT}
496 db transaction {
497 db eval { INSERT INTO t4 VALUES('two'); }
498 db transaction {
499 db eval { INSERT INTO t4 VALUES('three') }
500 db transaction {
501 db eval { INSERT INTO t4 VALUES('four') }
505 db eval {SELECT * FROM t4}
509 db transaction {
510 db eval { INSERT INTO t4 VALUES('A'); }
511 db transaction {
512 db eval { INSERT INTO t4 VALUES('B') }
513 db transaction {
514 db eval { INSERT INTO t4 VALUES('C') }
520 db eval {SELECT * FROM t4}
524 db eval {BEGIN ; COMMIT}
527 # Mess up a [db transaction] command by locking the database using a
532 sqlite3 db2 test.db
539 db transaction {
540 db eval {INSERT INTO t4 VALUES('five')}
546 db eval {BEGIN ; COMMIT}
549 # Thwart a [db transaction] command by locking the database using a
559 db transaction {
560 db eval {INSERT INTO t4 VALUES('five')}
567 db eval {BEGIN ; COMMIT}
570 sqlite3 db2 test.db
571 db transaction exclusive {
580 db eval {INSERT INTO t4 VALUES(6)}
581 db exists {SELECT x,x*2,x+x FROM t4 WHERE x==6}
584 db exists {SELECT 0 FROM t4 WHERE x==6}
587 db exists {SELECT 1 FROM t4 WHERE x==8}
590 tcl_objproc db exists {SELECT 1 FROM t4 WHERE x==8}
595 set version [db version]
607 db eval {CREATE TABLE t5(x BLOB)}
609 db eval {INSERT INTO t5 VALUES($x)}
610 db eval {SELECT typeof(x) FROM t5}
614 db eval {
621 db eval {
629 db eval {
637 db func xCall xCall
644 db one {SELECT x FROM t6 WHERE xCall()!='value'}
650 catch {db close}
651 sqlite3 db :memory:
656 db eval {CREATE TABLE t1(a); INSERT INTO t1 VALUES(1),(2),(3);}
657 db onecolumn {SELECT a FROM t1 WHERE a>2}
660 db exists {SELECT a FROM t1 WHERE a>2}
663 db exists {SELECT a FROM t1 WHERE a>3}
665 db profile noop-profile
667 db onecolumn {SELECT a FROM t1 WHERE a>2}
670 db exists {SELECT a FROM t1 WHERE a>2}
673 db exists {SELECT a FROM t1 WHERE a>3}
677 # 2017-06-26: The --withoutnulls flag to "db eval".
679 # In the "db eval --withoutnulls SQL ARRAY" form, NULL results cause the
682 # the [db nullvalue] string.
684 catch {db close}
685 forcedelete test.db
686 sqlite3 db test.db
694 db eval {SELECT * FROM t1} x {
701 db eval -unknown {SELECT * FROM t1} x {
710 db eval -withoutnulls {SELECT * FROM t1} x {
717 # Test the -type option to [db function].
723 db function add_i -returntype integer add
724 db function add_r -ret real add
725 db function add_t -return text add
726 db function add_b -returntype blob add
727 db function add_a -returntype any add
729 db function ret_i -returntype int ret
730 db function ret_r -returntype real ret
731 db function ret_t -returntype text ret
732 db function ret_b -returntype blob ret
733 db function ret_a -r any ret
784 list [catch { db function xyz -return object ret } msg] $msg
788 list [catch { db function xyz -return ret } msg] $msg
792 list [catch { db function xyz -n object ret } msg] $msg
813 db bind_fallback bind_callback
814 db eval {SELECT $abc, typeof($abc), $def, typeof($def), $ghi, typeof($ghi)}
817 db eval {SELECT quote(@def), typeof(@def)}
826 db bind_fallback
829 db bind_fallback {}
830 db eval {SELECT $abc, typeof($abc), $def, typeof($def), $ghi, typeof($ghi)}
835 db bind_fallback bind_callback
836 db eval {SELECT $abc, @def, $ghi(123), :mno}
840 set rc [catch {db bind_fallback a b} msg]
842 } {1 {wrong # args: should be "db bind_fallback ?CALLBACK?"}}
844 db bind_fallback bind_fallback_does_not_exist
849 db bind_fallback {}
853 db transaction {
854 db close
859 sqlite3 db test.db
861 db eval {SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3} { db close }
864 } {1 {invalid command name "db"}}
868 db close
873 sqlite3 db test.db
874 db func closedb closedb
875 db func func1 func1
879 db eval {
886 sqlite3 db :memory:
888 catch {db eval {SELECT 1 2 3;}} msg
889 db erroroffset