|
|
| version 1.9, 2019/10/24 15:29:59 | version 1.17, 2024/09/28 08:42:09 |
|---|---|
| Line 1 | Line 1 |
| @main[] | @main[] |
| $path[^os[Release/;.libs/lib]] | |
| $ext[^os[dll;so]] | |
| $SQL[ | $SQL[ |
| $.drivers[^table::create{protocol driver client connect | $.drivers[^table::create{protocol driver client connect |
| sqlite ../../sql/sqlite/.libs/libparser3sqlite.so libsqlite3.so sqlite://:memory:?multi_statements=1 | sqlite ../../sql/sqlite/${path}parser3sqlite.$ext ^os[sqlite3.dll;libsqlite3.so] sqlite://:memory:?multi_statements=1 |
| mysql ../../sql/mysql/.libs/libparser3mysql.so libmariadbclient.so mysql://@/?config_group=parser3&multi_statements=1 | mysql ../../sql/mysql/${path}parser3mysql.$ext ^os[libmySQL.dll;libmariadbclient.so] mysql://@/?config_group=parser3&multi_statements=1 |
| pgsql ../../sql/pgsql/.libs/libparser3pgsql.so libpq.so pgsql://test@localhost/test | pgsql ../../sql/pgsql/${path}parser3pgsql.$ext libpq.$ext pgsql://test@localhost/test |
| }] | }] |
| ] | ] |
| $ignore[^SQL.drivers.locate[protocol;pgsql]] | $sql[sqlite] |
| $ignore[^SQL.drivers.locate[protocol;$sql]] | |
| ^connect[$SQL.drivers.connect]{ | ^connect[$SQL.drivers.connect]{ |
| 1. 2 + 2 = ^string:sql{select 2+2} | 1. 2 + 2 = ^string:sql{select 2+2} |
| 2. void | 2. void |
| 2.0 $ignore[^try-catch{ ^void:sql{drop table pets} }] | 2.0 $ignore[^try-catch{ ^void:sql{drop table pets} }] |
| Line 23 $ignore[^SQL.drivers.locate[protocol;pgs | Line 28 $ignore[^SQL.drivers.locate[protocol;pgs |
| 2.2 ^void:sql{insert into pets values | 2.2 ^void:sql{insert into pets values |
| ('cat', 'milk', '^taint['very']', 5), | ('cat', 'milk', '^taint['very']', 5), |
| ('dog', 'bone', '^taint["never"]', 10), | ('dog', 'bone', '^taint["never"]', 10), |
| ('hamster', 'grain', null, 1), | |
| ('parrot', 'grain', 'alwayws', 1) | ('parrot', 'grain', 'alwayws', 1) |
| } | } |
| Line 30 $ignore[^SQL.drivers.locate[protocol;pgs | Line 36 $ignore[^SQL.drivers.locate[protocol;pgs |
| 2.4 ^try-catch{ ^void:sql{query}[ $.unknown[yes] ] } | 2.4 ^try-catch{ ^void:sql{query}[ $.unknown[yes] ] } |
| 2.5 ^try-catch{ ^void:sql{query}[ $.bind[ $.name[value] ] ] } | 2.5 ^try-catch{ ^void:sql{query}[ $.bind[ $.name[value] ] ] } |
| 2.6 Multiple queries: ^try-catch{ ^void:sql{delete from pets where pet='' ^; delete from pets where pet='' } } | 2.6 Multiple queries: ^try-catch{ ^void:sql{delete from pets where pet='' ^; delete from pets where pet=''} } |
| 2.7 Exception in second query: ^try-catch{ ^void:sql{delete from pets where pet='' ^; select 2+2 } } | 2.8 Multiple queries, data in first query: ^if($sql ne 'mysql'){ ^try-catch{ ^void:sql{select 2+2 ^; delete from pets where pet=''} } } |
| 2.9 Multiple queries, data in second query: ^try-catch{ ^void:sql{delete from pets where pet='' ^; select 2+2} } | |
| 3. int/double | 3. int/double |
| Line 43 $ignore[^SQL.drivers.locate[protocol;pgs | Line 51 $ignore[^SQL.drivers.locate[protocol;pgs |
| 3.5 ^try-catch{ ^double:sql{select -2}[ $.limit(0) ] } | 3.5 ^try-catch{ ^double:sql{select -2}[ $.limit(0) ] } |
| 3.6 ^double:sql{select -2}[ $.limit(0) $.default[1] ] | 3.6 ^double:sql{select -2}[ $.limit(0) $.default[1] ] |
| 3.7 Multiple queries, data in first query: ^try-catch{ ^int:sql{select 2+2 ^; delete from pets where pet=''} } | |
| 3.8 Multiple queries, data in second query: ^try-catch{ ^int:sql{delete from pets where pet='' ^; select 2+2} } | |
| 3.9 Multiple queries, data in both queries: ^try-catch{ ^int:sql{select 2+2 ^; select 3+3 } } | |
| 4. hash | 4. hash |
| Line 58 $ignore[^SQL.drivers.locate[protocol;pgs | Line 70 $ignore[^SQL.drivers.locate[protocol;pgs |
| 4.6 ^try-catch{ ^h[select 'dup', pet from pets; $.type[string] ]} | 4.6 ^try-catch{ ^h[select 'dup', pet from pets; $.type[string] ]} |
| 4.7 ^h[select pet from pets] | |
| 4.7.1 ^h[select aggressive from pets; $.type[table] ] | |
| 4.8 ^h[select food as key, pet from pets; $.type[table] $.distinct(true) ] | |
| 4.9 ^h[select food as key, pet from pets; $.type[string] $.distinct(true) ] | |
| 5. table | 5. table |
| Line 80 $ignore[^SQL.drivers.locate[protocol;pgs | Line 100 $ignore[^SQL.drivers.locate[protocol;pgs |
| 6.4 ^try-catch{ ^f[select aggressive from pets; $.limit(0) ] } | 6.4 ^try-catch{ ^f[select aggressive from pets; $.limit(0) ] } |
| 6.5 ^try-catch{ ^f[select 1 from pets] } - bug! | 6.5 ^try-catch{ ^f[select 1 from pets; $.limit(3) ] } - bug! |
| 6.6 ^try-catch{ ^f[select 1,2 from pets] } | 6.6 ^try-catch{ ^f[select 1,2 from pets] } |
| Line 114 $ignore[^SQL.drivers.locate[protocol;pgs | Line 134 $ignore[^SQL.drivers.locate[protocol;pgs |
| @s[query;options] | @s[query;options] |
| $s[^string:sql{$query}[$options]] | $s[^string:sql{$query}[$options]] |
| "$s" | "$s" |
| @postprocess[text] | |
| $result[^taint[as-is;$text]] |