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

The raw query interface #127

Open
CriztianiX opened this issue Sep 6, 2016 · 7 comments
Open

The raw query interface #127

CriztianiX opened this issue Sep 6, 2016 · 7 comments

Comments

@CriztianiX
Copy link

I'm a playing with sailor, and i see that Sailor does not provide a raw interface to execute queries.

So, i've added in resty_,mysql.lua something like this:

-- Gets instance for db
-- @return table_name
function db.get_instance()
    db.instantiate()
    db.connect()
    return db
end

And now i can do:

local db = require "sailor.db"
db.get_instance().query("SELECT * from articles") 

Why this feature is not available in the framework?
Can be added with a PR?
Thanks!

@Etiene
Copy link
Member

Etiene commented Sep 6, 2016

Hello! PRs are always welcome! 👯

But which version of Sailor are you using?
Isn't this method what you are looking for?
https://github.com/sailorproject/sailor/blob/master/src/sailor/db/resty_mysql.lua#L55

@CriztianiX
Copy link
Author

Hey, yes!, but can not call this method directly, because depends on instialisate, connect, etc.
So, get_instance() give you a db's instance ready for work.
Take a look my example.

@Etiene
Copy link
Member

Etiene commented Sep 7, 2016

Oh yes, of course. Hmm... yea! maybe we need a refactor over there :D

@CriztianiX
Copy link
Author

Yes, i think so, the db layer should be re-implemented.
I can work in this, any idea? Desing? Architecture ?

@Etiene
Copy link
Member

Etiene commented Sep 14, 2016

Which suggestions do you have in mind?

@CriztianiX
Copy link
Author

CriztianiX@944fba4

What do you think?

@Etiene
Copy link
Member

Etiene commented Oct 4, 2016

Added a new comment over there! ^_^

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