Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

sql or no-sql output #15

Open
mojtabye opened this issue Jan 21, 2018 · 8 comments
Open

sql or no-sql output #15

mojtabye opened this issue Jan 21, 2018 · 8 comments

Comments

@mojtabye
Copy link

http://querybuilder.js.org has the ability to convert the output to mongo or SQL queries, do you have any plan to add this future?

@mojtabye mojtabye changed the title sql or no sql output sql or no-sql output Jan 21, 2018
@dabernathy89
Copy link
Owner

Hey @mojtabye. I had a similar question in November:

#12

I think a plugin system for formatting output here would be useful. However, I wouldn't want to duplicate work if it isn't necessary - i'll have to look and see what my options are here.

On that same note, I'd like to get a 1.0 version out this year, and that probably means looking pretty closely at the default output of the component. I wonder if it would useful to try to emulate the jQuery QueryBuilder output, since that looks pretty popular? And it could pair with their server-side libraries.

Final note: I am hesitant about adding a SQL output option, b/c I don't want to encourage folks to generate SQL on the front-end and then use it server-side. I get why it would be useful, though.

@weedkiller
Copy link

i would be interested in sql option and also how to integrate with asp

@mattwmj
Copy link

mattwmj commented Jun 19, 2019

I did something similar at backend with java.
IMHO vue-query-builder is a frontend component and should not output sql.
Graphic QL may be?

@margsk
Copy link

margsk commented Jul 12, 2019

I don't think the front-end should output sql but a package for the back-end to parse the front-end output into sql would be great.

@dabernathy89
Copy link
Owner

Note to self - had an inquiry about an output option for Lucene queries.

@andreas83
Copy link

andreas83 commented Nov 7, 2019

Is there a Laravel/Eloquent rest endpoint implementation out there? if not, someone interested in creating one with me?

SQL Output
i have to agree with @dabernathy89, creating sql on the frontend side can´t be the solution here. We don't want to send generated sql queries to the server, where most people will not sanitize the input. i.e. how would you make a prepared statement? you would need to parse the sql and replace the variables etc etc... this is stupid idea compared of having a structured (json) which is send to the server, where some helper lib will generate sql or call the orm directly.

update
just found the example implementation for Laravel/Eloquent from @dabernathy89 (thx)
https://github.com/dabernathy89/vue-query-builder-laravel-example

@weedkiller
Copy link

@dabernathy89 I really like your idea of a plugin system, so I could use SQL or Lucene output and allow others to enhance modify or work on it without impact.

@dseeker
Copy link

dseeker commented Sep 23, 2020

I'd like to second the use case of generating SQL entries. in our case, we are using a widget to generate a SQL command, but not to execute it, which is then saved as an entry into a query list that is fed to the backend configuration. so it's an internal tool, not a direct database query, which would not have the pitfalls of it.

If anyone know how I can take the object generated by this component and create an SQL query please let me know, maybe some other package?

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

No branches or pull requests

7 participants