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

SELECT method #5

Closed
josuebrunel opened this issue Aug 14, 2014 · 3 comments
Closed

SELECT method #5

josuebrunel opened this issue Aug 14, 2014 · 3 comments
Assignees

Comments

@josuebrunel
Copy link
Owner

To make it simple. The idea is to be able to something like this :

from lokingyql import LokingYQL as yql
lk = yql()
lk.select(<tablename>).where(<dict: conditions>)

Got it ?

@josuebrunel josuebrunel self-assigned this Aug 14, 2014
@josuebrunel josuebrunel changed the title Select method Select method : object.select(<tablename>) Aug 14, 2014
@josuebrunel josuebrunel changed the title Select method : object.select(<tablename>) SELECT method : object.select(<tablename>) Aug 14, 2014
josuebrunel added a commit that referenced this issue Aug 14, 2014
@josuebrunel
Copy link
Owner Author

I didn't test it. Shame on me (--_)

@josuebrunel
Copy link
Owner Author

New thing. I was thinking about doing something like this

>>> yql.select().where([('name', '=', 'alain')])

In this case, we select the table from _self.current_table_

>>>yql.select('country', ['name', 'pop', 'capital']).where([('zone', '=', 'africa')])

This means that we select the table country. If _self.current_table_ is different from country, then _self.current_table_ = country.

All that leads to a new prototype of the method

def select(self, table, items=[]):
   #code

@josuebrunel josuebrunel changed the title SELECT method : object.select(<tablename>) SELECT method Aug 16, 2014
josuebrunel added a commit that referenced this issue Aug 16, 2014
@josuebrunel josuebrunel added this to the Core Features milestone Aug 16, 2014
@josuebrunel
Copy link
Owner Author

A new parameter is added : _limit_
The new prototype looks like

def select(self, table, items=[], limit=None):
    #code

Use as follow:

>>> yql.select('geo.countries', ['name', 'woeid'], 5).where(['place', '=', 'North America'])

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

No branches or pull requests

1 participant