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

Support for SQLite views? #1295

Open
gennaios opened this issue Aug 11, 2023 · 6 comments
Open

Support for SQLite views? #1295

gennaios opened this issue Aug 11, 2023 · 6 comments

Comments

@gennaios
Copy link

gennaios commented Aug 11, 2023

Hello,

It seems that views are not yet supported for SQLite? At least I didn't see them generated.

I use them as external content tables for full-text search. With the way FTS works with SQLite, in some cases I need to retrieve values from the view to delete or insert entries to the FTS index.

Such would be very helpful.

@stephenafamo
Copy link
Collaborator

I would be very happy to review a PR for this, I will label this so that anyone interested may decide to send one in.

@gennaios
Copy link
Author

gennaios commented Aug 22, 2023

My experience with go isn't that great but if I have the time I may be able to try. Seems that some of the code is already there. I also tried white listing views and such caused some error; perhaps a fix for that would go together.

@stephenafamo
Copy link
Collaborator

I also tried white listing views and such caused some error; perhaps a fix for that would go together.

What error did you get?

@gennaios
Copy link
Author

Error: unable to initialize tables: no tables found in database. Perhaps someday boiler needs to check whether a whitelist entry is a table or view. I haven't checked the docs, as I haven't tried such before, if views are specified differently.

Something else, perhaps boiler should by default exclude some SQLite tables. sqlite_stat1 and sqlite_stat4 are used to gather query statistics such that SQLite can later optimize such. An error from not blacklisting them:

Error: unable to initialize tables: primary key missing in tables (sqlite_stat4)

@stephenafamo
Copy link
Collaborator

Perhaps someday boiler needs to check whether a whitelist entry is a table or view.

A whitelist says "generate for only these tables/views". Since SQLite views are not supported, then if you whitelist only a view, it is the same as whitelisting a non-existent table.

Something else, perhaps boiler should by default exclude some SQLite tables. sqlite_stat1 and sqlite_stat4 are used to gather query statistics such that SQLite can later optimize such.

Kindly send in a PR for this 🙏🏾

@colbysparks
Copy link

colbysparks commented Jun 11, 2024

Something else, perhaps boiler should by default exclude some SQLite tables. sqlite_stat1 and sqlite_stat4 are used to gather query statistics such that SQLite can later optimize such..

Error: unable to initialize tables: primary key missing in tables (sqlite_stat1)

Bumping this. Could be nice. I might set up a PR if I have some time..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants