|
Post by bigbass on Apr 14, 2020 7:25:51 GMT 1
Hey guys I ported all of the sqlite demos then made a html page and a pdf it was a marathon they all work on the RPI3 and should work on 64 bit also having docs just for bacon users makes life a little bit easier *I got the geany colorized keyword syntax working Joe what happens is some threads get long and a bit messy the html tutorial allows us to organize everything in one place and just use the updated tested code it doesn't happen often because its a lot of work tutorial-sqlite-2020.tar.gz (163.42 KB)
|
|
|
Post by bigbass on Apr 16, 2020 16:59:20 GMT 1
I made an include file for sqlite3 for the raspberry pi the include file explains some of the changes and all of the functions were changed and IMPORTS are not used for this demo demo-sqlite-rpi3.tar.gz (1.79 KB) any testers? Joe The output should look like this The binary 3.32.0 located at /usr/bin/sqlite3 this is for scripted terminal use it is not used in this demo just a version check ------------------------------------------------------- Using SQLite lib version: 3.27.2 Located in /usr/lib method #1 simplified 123 Hello 234 cruel 345 world ---------------------------------------------------------- Get a count How many items in the database = 3 _____________ function returned value 1 TRUE ,0 FALSE 0 ---------------------------------------------------------- Test the include functions calling from the userland side 123 Hello 234 cruel 345 world ---------------------------------------------------------- Testing the users function MY_CALLBACK 123 Hello 234 cruel 345 world ----------------------------------------------------------
|
|
|
Post by bigbass on Apr 16, 2020 22:05:01 GMT 1
hello vovchik
this is what your demo looks like using the include_sqlite3.bac
not as pretty as your formatting but this is just a demo of how it would work with your demo ported just getting some practice with the include file in the above post
Joe
' ***********************************************************
'--- OBJECTIVE only show whats needed to use new include file '--- PROGRAM: moz2.bac INCLUDE "include_sqlite3.bac" '--- modified to take a new incude file and alterd the main code '--- to use the new function all user data almost the same '--- for just testing the new include file how to port bigbass 4-16-2020
' ported from ' PROGRAM: sql-mozart.bac ' PURPOSE: demo of BaCon sqlite3 commands ' AUTHOR: vovchik ' DEPENDS: bash, bacon, slqite3 ' DATE: 14-05-2010 ' VERSION: 0.1a ' ***********************************************************
INCLUDE "include_sqlite3.bac"
' Print version PRINT NL$, "Using SQLite lib version: ", DB_VERSION$ PRINT "Located in /usr/lib " PRINT
' Name of the data file - using in-memory database CONST datafile$ = ":memory:"
' Create a database mydb = DB_OPEN(datafile$)
'---manually formated ' Create table and add data DB_EXE("CREATE TABLE Works ( Koechel INTEGER, Title TEXT, Date TEXT,Place TEXT);") DB_EXE("INSERT INTO Works VALUES ('Title :','Koechel', 'Date', ' Place' );") DB_EXE("INSERT INTO Works VALUES (24, '8 Variations in G on Laat ons Juichen', ' January 1766', ' The Hague');") DB_EXE("INSERT INTO Works VALUES (25, 'Variations in D on Willem van Nassau', ' February 1766', ' Amsterdam');") DB_EXE("INSERT INTO Works VALUES (26, 'Sonata in E-flat for Violin and Keyboard', ' February 1766', ' The Hague');") DB_EXE("INSERT INTO Works VALUES (27, 'Sonata in G for Violin and Keyboard', ' February 1766', ' The Hague');") DB_EXE("INSERT INTO Works VALUES (28, 'Sonata in C for Violin and Keyboard', ' February 1766', ' The Hague');") DB_EXE("INSERT INTO Works VALUES (29, 'Sonata in D for Violin and Keyboard', ' February 1766', ' The Hague');") DB_EXE("INSERT INTO Works VALUES (30, 'Sonata in F for Violin and Keyboard', ' February 1766', ' The Hague');") DB_EXE("INSERT INTO Works VALUES (31, 'Sonata in B-flat for Violin and Keyboard', ' February 1766', ' The Hague');") DB_EXE("INSERT INTO Works VALUES (32, ' Gallimathias Musicum (Quodlibet)', ' March 1766', ' The Hague');") DB_EXE("INSERT INTO Works VALUES (33, 'Kyrie in F', ' June 1766', ' Paris');")
PRINT "method #1 simplified" '--- Execute query - method #1 simplified DB_EXE("SELECT * FROM Works;") PRINT "----------------------------------------------------------" PRINT
PRINT PRINT "Get a count" PRINT "How many items in the database = " ,DB_COUNT("SELECT COUNT(*) FROM Works;") PRINT "----------------------------------------------------------" PRINT
'--- Close database DB_CLOSE(mydb)
|
|
|
Post by bigbass on Mar 23, 2021 17:40:13 GMT 1
Hey Guys I did this awhile ago but now it can be finally used for reading and writing to mbtiles maps mbtiles maps have complex data stored in a sqlite3 database that's how they get all those zoom levels in one file the file format is called mbtiles and they use sqlite3 to organize the data in a database there is a lot to it but lets keep the info short for the demo The MBTiles specification is an efficient format for storing millions of tiles in a single SQLite database. Because MBTiles uses SQLite, it is ideal for sending data over the web, or displaying data on a mobile device. ----------------------------------------------------- I made a demo to read and write a real opencpn mbtiles map and this time I am using just bacon to do the work there is a README and it shows an expected output dependecies on debian sudo apt-get install sqlite3 libsqlite3-dev SQLite-MBTiles-Reader-Writer-1.0.tar.gz (2.71 KB) Joe
|
|
|
Post by alexfish on Mar 24, 2021 20:09:32 GMT 1
Hi Joe
Interesting, I have looked at the means in the past, re sqlite,
also noted another thread/post with a query about getting a binary blob
Vovchik suggested Bload,
any ideas
BR Alex
|
|
|
Post by bigbass on Mar 24, 2021 20:37:41 GMT 1
|
|
|
Post by bigbass on Mar 29, 2021 18:37:26 GMT 1
Just a note if you want easy
the easiest way to load a mbtiles map for viewing is import it into opencpn
this way you get all the benefits of gps locations too along with offline viewing
making your own custom mbtiles is some work but I guess anyone making their own custom maps understands this can be a complex process
the point here is mbtiles are really easy to load in opencpn if someone else did the hard part of making them first for you
Joe
================================= a note if you want to compile github.com/mapbox/tippecanoe
on the RPI3 I had to edit the Makefile here
changed to usr PREFIX ?= /usr
and add -latomic CXXFLAGCXXFLAGS := $(CXXFLAGS) -std=c++11 -latomicS := $(CXXFLAGS) -std=c++11 -latomic
for it to build
there was no configure script
|
|