|
1 | 1 | # QueryBuilder python module |
2 | 2 |
|
3 | 3 |  |
| 4 | + |
4 | 5 | [](https://github.com/co0lc0der/simple-query-builder-python/release) |
5 | 6 |  |
6 | 7 |  |
@@ -32,19 +33,19 @@ pip install https://github.com/co0lc0der/simple-query-builder-python/archive/mai |
32 | 33 | ### Main public methods |
33 | 34 | - `get_sql()` returns SQL query string which will be executed |
34 | 35 | - `get_params()` returns an array of parameters for a query |
35 | | -- `get_result()` returns query's results |
36 | | -- `get_count()` returns results' rows count |
| 36 | +- `get_result()` returns query's result |
| 37 | +- `get_count()` returns result's rows count |
37 | 38 | - `get_error()` returns `True` if an error is had |
38 | 39 | - `get_error_message()` returns an error message if an error is had |
39 | 40 | - `set_error(message)` sets `_error` to `True` and `_error_essage` |
40 | 41 | - `get_first()` returns the first item of results |
41 | 42 | - `get_last()` returns the last item of results |
42 | 43 | - `reset()` resets state to default values (except PDO property) |
43 | | -- `all()` executes SQL query and return all rows of result (`fetchall()`) |
44 | | -- `one()` executes SQL query and return the first row of result (`fetchone()`) |
45 | | -- `column(col_index)` executes SQL query and return the first column of result, `col_index` is `0` by default |
46 | | -- `go()` this method is for non `SELECT` queries. it executes SQL query and return nothing (but returns the last inserted row ID for `INSERT` method) |
47 | | -- `count()` prepares a query with SQL `COUNT()` function |
| 44 | +- `all()` executes SQL query and returns all rows of result (`fetchall()`) |
| 45 | +- `one()` executes SQL query and returns the first row of result (`fetchone()`) |
| 46 | +- `column(col_index)` executes SQL query and returns the first column of result, `col_index` is `0` by default |
| 47 | +- `go()` this method is for non `SELECT` queries. it executes SQL query and returns nothing (but returns the last inserted row ID for `INSERT` method) |
| 48 | +- `count()` prepares a query with SQL `COUNT(*)` function and executes it |
48 | 49 | - `query(sql, params, fetch_type, col_index)` executes prepared `sql` with `params`, it can be used for custom queries |
49 | 50 | - 'SQL' methods are presented in [Usage section](#usage-examples) |
50 | 51 |
|
|
0 commit comments