Reputation: 13693
I am following the example at the sqlcipher Api docs : http://sqlcipher.net/sqlcipher-api#attach
ATTACH DATABASE 'encrypted.db' AS encrypted KEY 'secret'; -- create a new encrypted database
CREATE TABLE encrypted.t1(a,b); -- recreate the schema in the new database (you can inspect all objects using SELECT * FROM sqlite_master)
INSERT INTO encrypted.t1 SELECT * FROM t1; -- copy data from the existing tables to the new tables in the encrypted database
DETACH DATABASE encrypted;
The first line CREATE TABLE encrypted.t1(a,b);
has (a,b) and the second
INSERT INTO encrypted.t1 SELECT * FROM t1;
does not.
Why is there an(a,b) in the first line and what is it for?.
Upvotes: 2
Views: 1755
Reputation: 1523
In this case a and b are the column names. The introduction to that example in the docs explains the important point "assume you have a standard SQLite database called unencrypted.db with a single table, t1(a,b)." Then:
Because the columns on the two tables are identical it is not necessary to list the table columns explicitly.
Upvotes: 3