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

feat: implement json search #882

Closed
wants to merge 1 commit into from
Closed

feat: implement json search #882

wants to merge 1 commit into from

Conversation

eaguad1337
Copy link
Member

No description provided.

@eaguad1337 eaguad1337 added enhancement A feature that exists, works as intended but needs to be improved Query Builder Related to the query builder labels Apr 10, 2024
@eaguad1337 eaguad1337 self-assigned this Apr 10, 2024
@@ -24,7 +24,7 @@ class SQLiteGrammar(BaseGrammar):
}

column_strings = {
"select": '{table}."{column}"{alias}{separator}',
"select": "{table}.`{column}`{json_path}{alias}{separator}",
Copy link
Member

Choose a reason for hiding this comment

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

why are are these " replaced with a ` symbol.

sqlite should be "" i think


def test_can_compile_json_where(self):
to_sql = self.builder.where("options->age", 18).to_sql()
self.assertEqual(to_sql, "SELECT * FROM \"users\" WHERE \"users\".`options`->'$.age' = '18'")
Copy link
Member

Choose a reason for hiding this comment

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

this syntax is invalid and i cant get this to run on sqlite

Copy link
Member Author

Choose a reason for hiding this comment

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

Weird. I swear I tested it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature that exists, works as intended but needs to be improved Query Builder Related to the query builder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants