summaryrefslogtreecommitdiff
path: root/sqlite3/testscript
blob: cfc48c8f12bf4cab624964bf3f60e097642468b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# file      : testscript
# copyright : not copyrighted - public domain

: basics
:
{
  sql = 'CREATE TABLE test (id INTEGER PRIMARY KEY);
INSERT INTO test VALUES(123);
SELECT * FROM test;'

  $* ':memory:' "$sql" >'123'
}

: archive
:
{
  echo 'abc' >=f.txt;
  $* f.sqlar -Ac f.txt &f.sqlar; # Creates archive adding a file.
  $* f.sqlar -At >f.txt;         # Lists files in archive.
  rm f.txt;
  $* f.sqlar -Ax;                # Extracts files from archive.
  cat f.txt >'abc'
}