dmarc-srg icon indicating copy to clipboard operation
dmarc-srg copied to clipboard

Initial support for SQLite database backend, fixes #56

Open AnnoyingTechnology opened this issue 2 years ago • 11 comments

Draft

AnnoyingTechnology avatar Mar 21 '23 14:03 AnnoyingTechnology

This seems to be working pretty well now.

AnnoyingTechnology avatar Mar 21 '23 15:03 AnnoyingTechnology

Hello @AnnoyingTechnology, Sorry for the delay in reply. I'm a bit busy right now, but I promise, I'll take a look at your PR soon.

liuch avatar Mar 23 '23 05:03 liuch

Hello @AnnoyingTechnology, Sorry for the delay in reply. I'm a bit busy right now, but I promise, I'll take a look at your PR soon.

no worries

AnnoyingTechnology avatar Mar 23 '23 06:03 AnnoyingTechnology

I don't think you've tested your code with the table prefix option. I'm right?

liuch avatar Mar 27 '23 19:03 liuch

I don't think you've tested your code with the table prefix option. I'm right?

Correct. As SQLite isn't a DBMS the file is the database and the need for prefix to avoid collisions when sharing a single database for multiple uses doesn't exist.

There is still a real issue though, I removed an order by somewhere that should have been kept. But at the time I couldn't make it work properly.

AnnoyingTechnology avatar Mar 27 '23 21:03 AnnoyingTechnology

Correct. As SQLite isn't a DBMS the file is the database and the need for prefix to avoid collisions when sharing a single database for multiple uses doesn't exist.

Yes, I understand you. But different prefixes can be used within the same project. For example, for tests or quick reports. The current code may delete tables beyond the prefix.

Added: What about Write-Ahead Logging: https://www.sqlite.org/wal.html ?

liuch avatar Mar 27 '23 22:03 liuch

Thanks for the feedback, I'll fix all of this.

Added: What about Write-Ahead Logging: https://www.sqlite.org/wal.html ?

What about it ? This is a performance/concurrency per-database setting. You you're concerned about what/where it is stored, it is comprised of the database name, with -wal suffix and (if enabled) lives in the same folder as the database.

But different prefixes can be used within the same project. For example, for tests or quick reports

The simplicity of changing the database file path, or copying a database file generally renders this moot. But I'll bring prefixes back.

AnnoyingTechnology avatar Mar 31 '23 07:03 AnnoyingTechnology

At least there is support for prefixes, there is support for sqlite, but nowhere is it stated that the prefixes will not work with sqlite. Your code only creates the appearance of working with prefixes. That's the main problem. If you don't want prefixes to be used with sqlite, it makes sense to EXPLICITLY disable running this configuration.

liuch avatar Apr 04 '23 22:04 liuch

If you don't want prefixes to be used with sqlite, it makes sense to EXPLICITLY disable running this configuration.

If you're OK with that, I'm fine with the application dying with Prefixes aren't supported with SQLite if the parameter isn't left empty.

AnnoyingTechnology avatar Apr 05 '23 06:04 AnnoyingTechnology

Okay. So be it.

liuch avatar Apr 06 '23 12:04 liuch

bump rebase merge ?

williamdes avatar Apr 17 '24 18:04 williamdes