Annotation of parser3/tests/429-sql.html, revision 1.2

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: 
1.2     ! moko       36:        2.9 ^try-catch{ ^a[select 2+2; $.bug(1) ] }
1.1       moko       37: 
                     38: @basic-tests-sparse[]
                     39:         basic tests sparse
                     40:        3.1 ^a[select weigth as key, pet from pets; $.type[table] $.distinct(true) ]
1.2     ! moko       41:        3.1.1 ^try-catch{ ^a[select weigth as key, pet from pets; $.type[table] ] }
1.1       moko       42: 
                     43:        3.2 ^a[select weigth as key, pet from pets; $.type[string] $.distinct(true) ]
1.2     ! moko       44:        3.2.1 ^try-catch{ ^a[select weigth as key, pet from pets; $.type[string] ] }
1.1       moko       45: 
                     46:        ^void:sql{delete from pets where pet='hamster'}
                     47: 
                     48:        3.3 ^a[select weigth, * from pets]
                     49: 
                     50:        3.4 ^a[select weigth, * from pets; $.type[table]]
                     51: 
                     52:        3.5 ^a[select weigth, food from pets; $.type[string] ]
                     53: 
                     54:        3.6 ^try-catch{ ^a[select weigth, * from pets; $.type[string] ]}
                     55: 
                     56:        3.7. ^a[select weigth, * from pets; $.type[table] $.limit(1) $.offset(1) ]
                     57: 
                     58:        3.8 ^try-catch{ ^a[select '1', pet from pets; $.type[string] ]}
                     59: 
                     60:        3.9 ^a[select weigth, pet from pets]
                     61: 
1.2     ! moko       62:        3.10 ^a[select weigth from pets]
        !            63: 
        !            64:        3.11 ^try-catch{ ^a[select -1 from pets] }
        !            65: 
1.1       moko       66: 
                     67: @multi-tests[]
                     68:        multi statements tests
                     69: 
1.2     ! moko       70:        1.1 ^a[delete from pets where pet='']
        !            71: 
1.1       moko       72:        1.2 ^a[select 0,* from pets^;select 1,* from pets; $.type[table] ]
                     73:  
                     74:        1.3 ^a[select 0,* from pets^;select 0,* from pets; $.type[table] ]
                     75: 
                     76:        1.4 ^a[select 0,* from pets^;select 0, 2+2; $.type[table] ]
                     77: 
                     78:        1.5 ^a[select 0,* from pets limit 2^;delete from pets where pet=''^;select 1,* from pets limit 1; $.type[table] ]
                     79: 
                     80:        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
                     81: 
                     82:        1.7 ^a[select weigth,food from pets^;select weigth+10,* from pets; $.type[table] ]
                     83: 
                     84:        1.8 ^a[select weigth,food from pets^;select weigth+10,* from pets;  ]
                     85: 
                     86:        1.9 ^a[select 0,* from pets^;select 0, 2+2; $.type[hash] ]
                     87:        1.10 ^a[select 0, 2+2^;select 0,* from pets; $.type[hash] ]
                     88: 
                     89:        1.11 ^a[select 0,food from pets^;select 1,* from pets; $.type[table] ]
                     90:        1.12 ^a[select 0,food from pets^;select 0,* from pets; $.type[table] ]
                     91: 
                     92: @a[query;options]
                     93:        $h[^array::sql{$query}[$options ^if($SPARSE){ $.sparse(true) } ^if($DISTINCT){ $.distinct(true) } ]]
                     94:        ^json:string[$h; $.indent(1) ^if($SPARSE){ $.array[object] } ]

E-mail: