spatialdude / usqlite

μSQLite library module for MicroPython
MIT License
87 stars 18 forks source link

Success Raspberry Pi Pico RP2 #4

Closed palmtreefrb closed 1 year ago

palmtreefrb commented 2 years ago

No issues at all, even though not required it build successfully with btree and my other frozen libraries. Followed RP2 instructions, no changes were required...

[ 95%] Linking CXX executable firmware.elf text data bss dec hex filename 654056 164 202416 856636 d123c /home/fredrick/micropython/ports/rp2/build-PICO/firmware.elf [ 95%] Built target firmware Scanning dependencies of target micropy_extmod_btree [ 95%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_close.c.obj [ 96%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_conv.c.obj [ 96%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_debug.c.obj [ 96%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_delete.c.obj [ 97%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_get.c.obj [ 97%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_open.c.obj [ 97%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_overflow.c.obj [ 98%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_page.c.obj [ 98%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_put.c.obj [ 98%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_search.c.obj [ 99%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_seq.c.obj [ 99%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_split.c.obj [ 99%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/btree/bt_utils.c.obj [100%] Building C object CMakeFiles/micropy_extmod_btree.dir/home/fredrick/micropython/lib/berkeley-db-1.xx/mpool/mpool.c.obj [100%] Built target micropy_extmod_btree fredrick@fredrick-XPS-13-9370:~/micropython/ports/rp2$

help('modules') main homie/node onewire uheapq _boot homie/property rp2 uio _onewire homie/validator ssd1306 ujson _rp2 lib/ftp_thread uarray uos _thread lib/inisetup uasyncio/init upip _uasyncio lib/mqtt_as uasyncio/core upip_utarfile builtins lib/primitives/init uasyncio/event urandom cmath lib/primitives/delay_ms uasyncio/funcs ure ds18x20 lib/primitives/message uasyncio/lock uselect framebuf lib/primitives/pushbutton uasyncio/stream usqlite gc lib/primitives/switch ubinascii ustruct homie/init machine ucollections usys homie/constants math uctypes utime homie/device micropython uerrno uzlib homie/network ntptime uhashlib Plus any modules on the filesystem import usqlite if not usqlite.mem_status(): ... usqlite.mem_status(True) ...
...
... True con = usqlite.connect("data.db") con.executemany( ... "BEGIN TRANSACTION;" ... "CREATE TABLE IF NOT EXISTS data (name TEXT, year INT);"+ ... "INSERT INTO data VALUES ('Larry', 1902);"+ ... "INSERT INTO data VALUES ('Curly', 1903);"+ ... "INSERT INTO data VALUES ('Moe', 1897);"+ ... "INSERT INTO data VALUES ('Shemp', 1895);"+ ... "COMMIT;") <Cursor 'NULL'>

with con.execute("SELECT * from data") as cur: ... for row in cur: ... print("stooge:", row) ...
...
... stooge: ('Larry', 1902) stooge: ('Curly', 1903) stooge: ('Moe', 1897) stooge: ('Shemp', 1895) con.close() print("usqlite mem - current:", usqlite.mem_current(), "peak:", usqlite.mem_peak()) usqlite mem - current: 0 peak: 97296

spatialdude commented 2 years ago

Awesome! Thanks for the feedback.