JoeRoddy / firestation

Firebase admin tool - executes SQL queries against Firebase
MIT License
141 stars 20 forks source link

Split out Query from UI #9

Closed benoj closed 5 years ago

benoj commented 6 years ago

Just wondering if you have thought about splitting out the UI and SQL translation api?

The SQL translation could be an interesting library on its own

JoeRoddy commented 6 years ago

I've definitely thought about this, but there's some UI specific code that is intertwined with the translation portions ( my own fault ), so it may be a bit of work.

What would you use it for? I don't think I would really recommend it as a means of not writing firebase code in your apps for a lot of reasons (mainly performance). But, I could see it being useful if you want to create applications similar to this one.

On Wed, Jun 13, 2018 at 11:47 AM, Ben Flowers notifications@github.com wrote:

Just wondering if you have thought about splitting out the UI and SQL translation api?

The SQL translation could be an interesting library on its own

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JoeRoddy/firestation/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/AP6tCsA8OSdx_wUQ8_LXz3cQcG45ho4Rks5t8TQrgaJpZM4Umdt5 .

benoj commented 6 years ago

One useful thing i was thinking of was database migrations - at the moment Im using zorba/jsonIq but its a bit of a pain.

In Java world I use a lot LiquidDB (which is essentially a wrapper around SQL scripts) - this could be used in a combination with some scripts to create a relatively nice migration of data. (This is just the first thing in my head right now - I'm sure there are many other use cases)

Let me know if you are interested in pulling it out - I think the DB migration could be cool :)

JoeRoddy commented 6 years ago

I'll give you a heads up if I end up doing this.

I do think it's a good idea, I'm just not sure when I'll have the time / where it is on my priorities at the moment.

That said, if you wanted to take a crack at creating your own npm module from the code in this repo, I would happily migrate to using it as a dependency. :D

JoeRoddy commented 5 years ago

@benoj Hey! Would you be willing to try this out when you get time? I'd love feedback.

https://github.com/JoeRoddy/firebase-sql

benoj commented 5 years ago

Will try and have a look at this :)

JoeRoddy commented 5 years ago

@benoj Forgot to mention it's specifically for interacting w/ the JavaScript client libraries. Not sure if you use JS at all. Do you think it would be useful to make a CLI tool as well? That way, theoretically, you could use this in any language,

more or less in Java:

Process p = Runtime.getRuntime().exec(new String[]{"bash","-c","fbsql select * from users"});
// read output stream

or, just execute a .sh script.

This would also let you just run a quick command from the terminal if you need to see results, not sure how useful that is though.

Shoshin23 commented 5 years ago

I love to have a straight up CLI tool to extract the query results to a CSV file so I can process them elsewhere. The Firestation App is good for testing out what queries in a nice GUI interface but csv export is missing there. Would really really love that.

JoeRoddy commented 5 years ago

Thanks for the feedback @Shoshin23 ! I'll shoot you a message if I implement a CLI.