Annotation of parser3/tests/429-sql.html, revision 1.1
1.1 ! moko 1: @USE
! 2: 388-sql.html
! 3:
! 4: @main[]
! 5:
! 6: ^connect[$SQL.drivers.connect]{
! 7: ^prepare-data[]
! 8: ^basic-tests[]
! 9: ^multi-tests[]
! 10:
! 11: $SPARSE(1)
! 12: ^basic-tests-sparse[]
! 13: $DISTINCT(1)
! 14: ^prepare-data[]
! 15: ^multi-tests[]
! 16: }
! 17:
! 18: @basic-tests[]
! 19: basic tests
! 20: 2.1 ^a[select * from pets]
! 21:
! 22: 2.2 ^a[select * from pets; $.type[table]]
! 23:
! 24: 2.3 ^a[select pet from pets]
! 25:
! 26: 2.4 ^a[select pet from pets; $.type[string] ]
! 27:
! 28: 2.5 ^try-catch{ ^a[select * from pets; $.type[string] ]}
! 29:
! 30: 2.6 ^try-catch{ ^a[select * from pets; $.distinct(true) ]}
! 31:
! 32: 2.7 ^a[select * from pets; $.type[table] $.limit(1) $.offset(1) ]
! 33:
! 34: 2.8 ^a[select aggressive from pets; $.type[table] ]
! 35:
! 36:
! 37: @basic-tests-sparse[]
! 38: basic tests sparse
! 39: 3.1 ^a[select weigth as key, pet from pets; $.type[table] $.distinct(true) ]
! 40:
! 41: 3.2 ^a[select weigth as key, pet from pets; $.type[string] $.distinct(true) ]
! 42:
! 43: ^void:sql{delete from pets where pet='hamster'}
! 44:
! 45: 3.3 ^a[select weigth, * from pets]
! 46:
! 47: 3.4 ^a[select weigth, * from pets; $.type[table]]
! 48:
! 49: 3.5 ^a[select weigth, food from pets; $.type[string] ]
! 50:
! 51: 3.6 ^try-catch{ ^a[select weigth, * from pets; $.type[string] ]}
! 52:
! 53: 3.7. ^a[select weigth, * from pets; $.type[table] $.limit(1) $.offset(1) ]
! 54:
! 55: 3.8 ^try-catch{ ^a[select '1', pet from pets; $.type[string] ]}
! 56:
! 57: 3.9 ^a[select weigth, pet from pets]
! 58:
! 59:
! 60: @multi-tests[]
! 61: multi statements tests
! 62:
! 63: 1.2 ^a[select 0,* from pets^;select 1,* from pets; $.type[table] ]
! 64:
! 65: 1.3 ^a[select 0,* from pets^;select 0,* from pets; $.type[table] ]
! 66:
! 67: 1.4 ^a[select 0,* from pets^;select 0, 2+2; $.type[table] ]
! 68:
! 69: 1.5 ^a[select 0,* from pets limit 2^;delete from pets where pet=''^;select 1,* from pets limit 1; $.type[table] ]
! 70:
! 71: 1.6 ^a[select 0,* from pets^;delete from pets where pet=''^;select 1,* from pets; $.type[table] $.limit(1) ] - minor bug: limit for last query only
! 72:
! 73: 1.7 ^a[select weigth,food from pets^;select weigth+10,* from pets; $.type[table] ]
! 74:
! 75: 1.8 ^a[select weigth,food from pets^;select weigth+10,* from pets; ]
! 76:
! 77: 1.9 ^a[select 0,* from pets^;select 0, 2+2; $.type[hash] ]
! 78: 1.10 ^a[select 0, 2+2^;select 0,* from pets; $.type[hash] ]
! 79:
! 80: 1.11 ^a[select 0,food from pets^;select 1,* from pets; $.type[table] ]
! 81: 1.12 ^a[select 0,food from pets^;select 0,* from pets; $.type[table] ]
! 82:
! 83: @a[query;options]
! 84: $h[^array::sql{$query}[$options ^if($SPARSE){ $.sparse(true) } ^if($DISTINCT){ $.distinct(true) } ]]
! 85: ^json:string[$h; $.indent(1) ^if($SPARSE){ $.array[object] } ]
E-mail: