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 +0200

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 +0200

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?

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
2

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

Rikujolla gravatar image

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

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

edit flag offensive delete publish link more

Comments

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

make228 ( 2020-03-20 20:15:15 +0200 )edit
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 +0200 )edit
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

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

Seen: 553 times

Last updated: Mar 20 '20