ericsink / SQLitePCL.raw

A Portable Class Library (PCL) for low-level (raw) access to SQLite
Apache License 2.0
512 stars 106 forks source link

Add virtual module support #486

Closed kant2002 closed 1 year ago

kant2002 commented 2 years ago

This is draft of changes to T4 template. I would like to receive feedback where to place declaration of sqlite3_module

Also would like to know, do I need to run generate process on the code?

ericsink commented 2 years ago

I thought I replied to this, but apparently not.

I can help with your questions about where to place the declaration and whether to run T4 when this PR is closer to being ready for merge. There is a lot of work to be done yet in order to actually support virtual modules.

kant2002 commented 2 years ago

@ericsink I decide to take detour for virtual modules while I investigate what I should do. I add sqlite3_drop_modules which seems to be simpler. I would plan to extract last commit into separate PR, if in principle everything is ok. Can you guide me on the next steps?

ericsink commented 2 years ago

I believe sqlite3_drop_modules is another part of the same overall feature, virtual modules. In other words, the virtual modules feature (which would be an enormous effort) would require quite a few method implementations to be useful, and sqlite3_drop_modules() would be one of those.

kant2002 commented 2 years ago

I agree that sqlite3_drop_modules closely related to virtual module, but I think it can be implemented and tested separately and it would make some sense.

For example attach CSV module read data from it, drop modules and try read again, it should fails.

What I'm trying to achieve here is split work on some manageable (for me) chunks. I hope that way you can show me project specific things which I cannot figure out myself, like testing requirements, maybe you have some insights on better marshaling, or maybe you want me change API somehow.

All these small things should helps me do less mistakes on the actual sqlite3_create_module implementation which definitely would be quite involved. At least that's the plan. Obviously based on your input I'll do some corrections.

ericsink commented 2 years ago

If you want to try implementing a new sqlite3_ method, I suggest first reading the diffs from past commits that did that.

For example, c35a21987e04bb15cc76b4c886226fd92e40efef added several new API methods. And tests for them were added in e8ef043dfaae283c89f701f7f20fc25563625618.