We have moved to a new Sailfish OS Forum. Please start new discussions there.
0

Sailfish os + SQL

asked 2020-03-20 18:26:57 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2020-03-20 18:26:57 +0300

make228 gravatar image

Hey! I'm new with sailfish os. I'm learning now sql database programming language. Can i use SQL with sailfish somehow?

add a comment

1 Answer

Sort by » oldest newest most voted
2

answered 2020-03-20 19:24:39 +0300

Rikujolla gravatar image

updated 2020-03-20 19:26:10 +0300

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:)

link

Comments

i can't use any programming language for app developing.

make228 ( 2020-03-20 20:15:15 +0300 )
1

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 )
add a comment
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2020-03-20 18:26:57 +0300

Seen: 585 times

Last updated: Mar 20 '20