Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared auto-increment does not work with wp-sqlite-db #16

Open
carlomanf opened this issue Dec 9, 2022 · 1 comment
Open

Shared auto-increment does not work with wp-sqlite-db #16

carlomanf opened this issue Dec 9, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@carlomanf
Copy link
Owner

I was testing the plugin with the https://github.com/aaemnnosttv/wp-sqlite-db drop-in and found that the shared auto-increment does not work. This is because sqlite has an entirely different syntax for managing auto-increment to mysql.

Equivalent code for mysql:

SELECT `auto_increment` FROM `information_schema`.`tables` WHERE `table_schema` = 'dbname' AND `table_name` = 'wp_posts';
ALTER TABLE `wp_posts` AUTO_INCREMENT = 100;

Equivalent code for sqlite:

SELECT `seq` FROM `sqlite_sequence` WHERE `name` = 'wp_posts';
UPDATE `sqlite_sequence` SET `seq` = 100 WHERE `name` = 'wp_posts';
@carlomanf carlomanf added the bug Something isn't working label Dec 9, 2022
@carlomanf
Copy link
Owner Author

Upon inspecting the drop-in code, it looks like it rewrites some of the syntax differences itself and perhaps it should handle this too. Given that sqlite support is in flux right now, having been moved into the Performance Lab plugin and potentially later into core, it might be wise to wait for a while before deciding how to proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant