Sailfish os + SQL
asked 2020-03-20 18:26:57 +0300

This post is a wiki. Anyone with karma >75 is welcome to improve it.
Hey! I'm new with sailfish os. I'm learning now sql database programming language. Can i use SQL with sailfish somehow?
asked 2020-03-20 18:26:57 +0300
This post is a wiki. Anyone with karma >75 is welcome to improve it.
Hey! I'm new with sailfish os. I'm learning now sql database programming language. Can i use SQL with sailfish somehow?
SailfishOS uses sqlite3 for sql. You can use it by adding QtQuick.LocalStorage 2.0 to your app. There are plenty of apps e.g. in GitHub where you can learn best practices. May be it is not wise to copy from my apps not to learn bad practices:)
You can use sqlite3 on the command line. Make sure, sqlite is installed:
$ rpm -qf /usr/bin/sqlite3
sqlite-3.13.0+git3-1.3.12.jolla.armv7hl
Now you can use SQL:
$ sqlite3 /tmp/test.db
SQLite version 3.13.0 2016-05-18 10:57:30
Enter ".help" for usage hints.
sqlite> create table test (name varchar primary key, age int);
sqlite> insert into test values ('eierkopp', 99);
sqlite> select * from test;
eierkopp|99
Eierkopp (
2020-03-20 20:49:05 +0300
)Asked: 2020-03-20 18:26:57 +0300
Seen: 585 times
Last updated: Mar 20 '20