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

Using usql as a library #16

Closed
jaxxstorm opened this issue Mar 15, 2017 · 4 comments
Closed

Using usql as a library #16

jaxxstorm opened this issue Mar 15, 2017 · 4 comments

Comments

@jaxxstorm
Copy link

First of all, props on an amazing project!

I'd like to utilize some of the awesome here in my own golang app. The idea is that I could wrap around usql and utilize it to drop me into a sql prompt.

Is this possible, short of shelling out to the usql binary? Which functions/methods could I use?

@kenshaw
Copy link
Member

kenshaw commented Mar 15, 2017

There's not a whole lot of logic in usql that is specific to it. It uses chzyer/readline for doing the "readline" stuff. usql isn't much different (yet) from their multiline example.

I'm in the middle of making usql much more modular in general, and will try to make it reusable by other packages, but it's not at that state yet.

@kenshaw kenshaw closed this as completed Mar 15, 2017
@kenshaw
Copy link
Member

kenshaw commented Mar 16, 2017

Please check out the latest version of usql, specifically the usql/handler package. It's not 100% modular yet, but I will in the next week or so refactor all the actual SQL stuff out of that package completely.

@jaxxstorm
Copy link
Author

Amazing turnaround! thanks!

@kenshaw
Copy link
Member

kenshaw commented Mar 16, 2017

Well, the work on this revision had been in process for the last few days. Have been trying to make it do "some parsing" to better execute queries / behave more like psql. Not 100% there yet, but much much closer now.

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

No branches or pull requests

2 participants