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

Add pragma function capability to sqlite #4700

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mannydelgado
Copy link

Sqlite has had the ability to use pragma functions since 3.16.0, for sqldelight we should add the ability to use the same functions. For more information about pragma functions please look at: https://www.sqlite.org/pragma.html#pragma_functions
Add the ability to use PRAGMA functions within sql select statements.

import com.intellij.lang.ASTNode
import com.intellij.psi.tree.TokenSet

internal abstract class PragmaFunctionValidatorMixin(node: ASTNode) : SqlPragmaNameImpl(node) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

because this is being used in the from clause i expect it will also need to return correct types

you can look at the json mixin for inspiration for doing something similar, since it also adds table valued functions for the sqlite json extension:

https://github.com/cashapp/sqldelight/blob/master/dialects/sqlite/json-module/src/main/kotlin/app/cash/sqldelight/dialects/sqlite/json/module/grammar/json.bnf#L23-L30

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.

None yet

2 participants