2010-09-09 22:58:34 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-03-22 20:16:35 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2010-09-09 22:58:34 +00:00
|
|
|
cd /tmp
|
|
|
|
echo '### Test of sqlite'
|
|
|
|
for CMDSQL in sqlite sqlite3 ; do
|
|
|
|
echo "Current command: $CMDSQL"
|
|
|
|
rm -f sqltest.$CMDSQL
|
|
|
|
# create database & table
|
|
|
|
sql $CMDSQL:///sqltest.$CMDSQL "CREATE TABLE foo(n INT, t TEXT);"
|
2013-11-29 22:30:50 +00:00
|
|
|
sql --list-tables $CMDSQL:///sqltest.$CMDSQL
|
2010-09-09 22:58:34 +00:00
|
|
|
file sqltest.$CMDSQL
|
|
|
|
sql $CMDSQL:///sqltest.$CMDSQL "INSERT INTO foo VALUES(1,'Line 1');"
|
|
|
|
sql $CMDSQL:///sqltest.$CMDSQL "INSERT INTO foo VALUES(2,'Line 2');"
|
|
|
|
sql $CMDSQL:///sqltest.$CMDSQL "SELECT * FROM foo;"
|
|
|
|
sql -n $CMDSQL:///sqltest.$CMDSQL "SELECT * FROM foo;"
|
|
|
|
sql -s '.' $CMDSQL:///sqltest.$CMDSQL "SELECT * FROM foo;"
|
|
|
|
sql -n -s '.' $CMDSQL:///sqltest.$CMDSQL "SELECT * FROM foo;"
|
|
|
|
sql -s '' $CMDSQL:///sqltest.$CMDSQL "SELECT * FROM foo;"
|
|
|
|
sql -s ' ' $CMDSQL:///sqltest.$CMDSQL "SELECT * FROM foo;"
|
|
|
|
sql --html $CMDSQL:///sqltest.$CMDSQL "SELECT * FROM foo;"
|
|
|
|
sql -n --html $CMDSQL:///sqltest.$CMDSQL "SELECT * FROM foo;"
|
|
|
|
sql --dbsize $CMDSQL:///sqltest.$CMDSQL
|
|
|
|
sql $CMDSQL:///sqltest.$CMDSQL "DROP TABLE foo;"
|
|
|
|
sql --dbsize $CMDSQL:///sqltest.$CMDSQL
|
|
|
|
rm -f sqltest.$CMDSQL
|
|
|
|
done
|
|
|
|
|