-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.ijs
29 lines (22 loc) · 899 Bytes
/
test.ijs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
NB. some tests from wiki pages https://code.jsoftware.com/wiki/Addons/data/sqlite
load 'data/sqlite'
sqlite_info_psqlite_''
db=: sqlopen_psqlite_ '~addons/data/sqlite/db/sandp.db'
sqltables__db''
sqlmeta__db 's'
sqlread__db 'select * from s'
sqlreads__db 'select * from s'
sqlreads__db 's'
sqlreads__db 's where status=30 order by city'
sqlreads__db 'sid,sum(qty),max(qty) from sp group by sid'
db=: sqlcopy_psqlite_ '~addons/data/sqlite/db/sandp.db';'~temp/sandp.db'
cls=: ;:'sid name status city'
dat=: ('s6';'s7');('brown';'eaton');40 10;<'rome';'madrid'
sqlinsert__db 's';cls;<dat
5 sqltail__db 's' NB. last 5 records
sqlupdate__db 'p';'weight=12';('name';'city');<'hammer';'vienna'
sqlhead__db 'p where weight=12'
sqlupdate__db 'p';'weight=12';(,<'name');<,<'hammer'
dat=: ('s5';'s8');('adams';'scott');50 60;<'lisbon';'berlin'
sqlupsert__db 's';'sid';cls;<dat
5 sqltail__db 's'