Sqlite3?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
jayfehr
Posts: 4
Joined: Sun Mar 23, 2014 2:17 pm

Sqlite3?

Post by jayfehr » Sun Mar 23, 2014 2:22 pm

I'm curious if it is going to be possible to use the Sqlite libraries with µPython? Having the ability to write to onboard flash memory is awesome, having the ability to store the same data in a relational manner would be a step above.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Sqlite3?

Post by pfalcon » Mon Mar 24, 2014 9:35 am

There will be definitely sqlite module for "unix" port. For baremetal MCU ports, sqlite sounds too big/bloated. And the question whether it's possible at all depends on its heap memory usage. This posts doesn't show optimistic minimal memory usage, so it's likely not possible on a typical MCU without external RAM (without someone spending time to optimize it). And that's only minimal usage - with SQL, potential memory usage is unbound.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Sqlite3?

Post by pfalcon » Mon Mar 24, 2014 9:41 am

Though that post is from 2009, and http://www.sqlite.org/malloc.html lists impressive properties of memory subsystem of modern sqlite, for example, ability work against static buffer. So, someone just needs to test how well it would work with say 16K memory arena ;-).
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: Sqlite3?

Post by pfalcon » Thu Apr 17, 2014 12:58 am

FYI, I started implementing bindings for sqlite3: https://github.com/micropython/micropyt ... er/sqlite3
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

Post Reply