Skip to content

Conversation

JanJakes
Copy link
Member

@JanJakes JanJakes commented Oct 6, 2025

With the new SQLite driver, we keep running into issues with missing and incorrect database name values (#197, #203, #226, #260, #261, and other issues).

Thinking through this further, I came to the conclusion that to provide maximum flexibility and portability, it would be best to provide an API in the shape of:

"Mount my-sqlite-file.sqlite as my-db-name."

Even if we consider adding multi-database support one day, it would still be great to allow mounting additional SQLite files under dynamic database names.

I don't see any downsides to doing this, except maybe that we'll have to choose some database name in some scenarios, such as in database admin tools. However, in these cases we can use a reasonable default or the file name.

This is a WIP pull request demonstrating the simplest approach. For it to be merged, I only need to resolve how the existing database name values should be treated.

@JanJakes JanJakes requested a review from adamziel October 6, 2025 14:30
Copy link

@sejas sejas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JanJakes, thanks for working on this issue. If I understand correctly, this change lets the SQLite plugin mount the database with any DB_NAME automatically. The constant is still needed, but its value no longer affects accessing the database.

@sejas
Copy link

sejas commented Oct 9, 2025

@JanJakes, do you think this is good to merge, or should we go with the WP_SQLITE_DB_NAME constant in the meantime?

@JanJakes
Copy link
Member Author

@sejas I'll try to finish this one now. What it misses is support for wildcards like SELECT * FROM infromation_schema.tables, or more complex ones with JOINs, etc. I'll give it a try.

@JanJakes
Copy link
Member Author

I'm closing this in favor of #266.

@JanJakes JanJakes closed this Oct 14, 2025
@JanJakes JanJakes deleted the dynamic-db-name branch October 14, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants