usqlite icon indicating copy to clipboard operation
usqlite copied to clipboard

Micropython 1.21 windows port: Compile error

Open emile-cronje opened this issue 1 year ago • 7 comments

Good day

Are there any plans to make usqlite compatible with micropython 1.21? I get a compile error in usqlite_cursor.c in function:

STATIC mp_obj_t row_tuple(usqlite_cursor_t *cursor) { int columns = sqlite3_data_count(cursor->stmt);

mp_obj_tuple_t *o = m_new_obj_var(mp_obj_tuple_t, mp_obj_t, columns);
o->base.type = &mp_type_tuple;
o->len = columns;

for (int i = 0; i < columns; i++)
{
    o->items[i] = usqlite_column_value(cursor->stmt, i);
}

return MP_OBJ_FROM_PTR(o);

}

syntax error: ')' in line: mp_obj_tuple_t *o = m_new_obj_var(mp_obj_tuple_t, mp_obj_t, columns);

Regards

emile-cronje avatar Dec 11 '23 21:12 emile-cronje

I'm interested to use sqlite too, but to use in the ESP32-S3 Microcontroller.

beyonlo avatar Dec 14 '23 19:12 beyonlo

@emile-cronje @beyonlo Please try the latest v0.1.4 code, it should resolve the issues with the latest version of micropython.

spatialdude avatar Dec 18 '23 11:12 spatialdude

@spatialdude just to be sure, this project usqlite works also on the micropython for microcontrollers, like as the ESP32, or just for the micropython UNIX/Windows port?

beyonlo avatar Dec 18 '23 13:12 beyonlo

@beyonlo Yes it does work on microcontrollers and the ones I have personally used it on are included here https://github.com/spatialdude/usqlite#ports Do consider if you have enough memory available on your target device to meet your requirements. The memory usage can also be configured - https://github.com/spatialdude/usqlite#memory-allocation-configuration

spatialdude avatar Dec 18 '23 20:12 spatialdude

@spatialdude thank you!

Some more questions:

  1. What is the relation of this project with the official micropython lib (that has these files/sqlite support): https://github.com/micropython/micropython-lib/tree/master/unix-ffi/sqlite3
  2. Can this project be a official sqlite3 for the micropython?
  3. Is this project active? While I was writing this post, I see that you did yesterday new commits and now the usqlite suppport that last sqlite version - 2023-11-24 (3.44.2). I was starting to ask you if is active because I saw the last commits was two years ago. Well, my fear is if is there intention to continue supporting and developing this project supporting always the last sqlite version?

Sorry for many questions, but I love sqlite and would like to start using it in the microcontrollers with micropython!

Thank you in advance!

beyonlo avatar Dec 19 '23 16:12 beyonlo

@beyonlo There is no official relationship between μSQLite and MicroPython, they're just friends 😉

I would be pleased for μSQLite to be included as a module in MicroPython, but the decision would beed to be made by the MicroPython team @dpgeorge on that if there was sufficient demand from the MP community.

Otherwise I try to routinely keep μSQLite up to date with both MicroPython and SQLite releases.

spatialdude avatar Jun 01 '24 10:06 spatialdude

I really like this project, and it's good to see @spatialdude keep it up-to-date.

I would be pleased for μSQLite to be included as a module in MicroPython, but the decision would beed to be made by the MicroPython team @dpgeorge on that if there was sufficient demand from the MP community.

At this stage I still think it makes sense to have this as a separate project, similar to ulab https://github.com/v923z/micropython-ulab.

Although we have had requests to bundle sqlite3 support with the new webassembly port, so I'll be looking into that in the near future. Will be interesting to see how we can make that work.

dpgeorge avatar Jun 02 '24 10:06 dpgeorge