Create a database file in the specified path.
| Parameters: |
|
|---|---|
| Raises: |
|
Get a list of tables present in the database.
| Parameters: | db_path (str) – path to the database |
|---|---|
| Returns: | list of all the tables ordered by key |
| Raises: |
|
Determine whether the specified file is a breezedb database or not.
| Parameters: | db_path (str) – path to the database |
|---|---|
| Returns: | True or False |
Remove the breezedb database in the specified path.
| Parameters: | db_path (str) – path to the database |
|---|---|
| Raises: |
|
Creates a row of elements in the given table.
Loops through the list of fields in the table and adds the corresponding element.
| Parameters: |
|
|---|---|
| Rasies IndexError: | |
invalid number of elements |
|
| Raises: |
|
Empty the content of a specific element.
The content is emptied instead of removing the whole element because a single element cannot be removed.
| Parameters: |
|
|---|---|
| Raises: |
|
Check if a row with the given index exists in the table.
| Parameters: |
|
|---|---|
| Returns: | True or false |
| Raises: |
|
Get the data contained in a specific element.
| Parameters: |
|
|---|---|
| Returns: | content of the element |
| Raises: |
|
Modify the content of an element.
| Parameters: |
|
|---|---|
| Raises: |
|
Remove an element row from the specified table.
| Parameters: |
|
|---|---|
| Raises: |
|
Create a new field in the table.
Adds the empty field to already existing rows.
| Parameters: |
|
|---|---|
| Raises: |
|
Empty the contents of a field on a single row of the table.
| Parameters: |
|
|---|---|
| Raises: |
|
Empty the contents of a field on every row of the table.
| Parameters: |
|
|---|---|
| Raises: |
|
Check whether a field exists in the table or not.
| Parameters: |
|
|---|---|
| Returns: | True or False |
| Raises IOError: | cannot open file |
Get the data contained in the field for every row in the table.
| Parameters: |
|
|---|---|
| Returns: | data list sorted by order of appearance |
| Raises: |
|
Get the data type contained in a specific field for parsing purposes.
| Parameters: |
|
|---|---|
| Returns: | string with the data type |
| Raises: |
|
Remove a field from the table.
Removes the field from both the list of fields and every row of the table.
| Parameters: |
|
|---|---|
| Raises: |
|
Rename a field.
Renames both the element in the fields list and every row of the table.
| Parameters: |
|
|---|---|
| Raises: |
|
Swap two field indexes in the specified table. This affects the priority order of the fields.
| Parameters: |
|
|---|---|
| Raises: |
|
Create a new table in the database.
| Parameters: |
|
|---|---|
| Raises: |
|
Check whether a table exists in the database or not.
| Parameters: |
|
|---|---|
| Returns: | True or False |
| Raises: |
|
Get a list of fields present in the table.
| Parameters: |
|
|---|---|
| Returns: | list containing the fields of the table |
| Raises: |
|
Get the elements located in a row of the table.
| Parameters: |
|
|---|---|
| Returns: | list containing the data of the row, ordered by field |
| Raises: |
|
Get a list of all the rows in the table
| Parameters: |
|
|---|---|
| Returns: | list of data rows in dictionary format |
| Raises: |
|
Remove a table from the database.
| Parameters: |
|
|---|---|
| Raises: |
|
Rename a table from the database.
| Parameters: |
|
|---|---|
| Raises: |
|
Search data in the table and obtain the index of the rows that match the criteria.
| Parameters: |
|
|---|---|
| Returns: | list of indexes that match the criteria |
| Raises: |
|
Parses the query and divides it into subqueries where possible.
| Parameters: | query (str) – query to parse |
|---|
Run a CREATE operation. This operation works with databases, tables and fields.
| Raises Exception: | |
|---|---|
| incorrect query syntax, incorrect number of parameters | |
Run an EMPTY operation. This operation works with fields and elements.
| Raises Exception: | |
|---|---|
| incorrect query syntax | |
Run an EXISTS operation. This operation works with tables, fields and rows.
| Returns: | True or False |
|---|---|
| Raises Exception: | |
| incorrect query syntax | |
Run a GET operation. This operation works with databases, tables, fields and elements.
| Returns: | list of results obtained from the query |
|---|---|
| Raises Exception: | |
| incorrect query syntax | |
Run a MODIFY operation. This operation only works with elements.
| Raises Exception: | |
|---|---|
| incorrect query syntax | |
Run a REMOVE operation. This operation works with databases, tables, fields and elements.
| Raises Exception: | |
|---|---|
| incorrect query syntax | |
Run a RENAME operation. This operation works with tables and fields.
| Raises Exception: | |
|---|---|
| incorrect query syntax | |
Run the query.
Run a SEARCH operation.
| Returns: | list of results obtained from the query |
|---|---|
| Raises Exception: | |
| incorrect query syntax | |
Run a SWAP operation. This operation only works with fields.
| Raises Exception: | |
|---|---|
| incorrect query syntax | |
Parse and execute a query in the database.
This function divides the query (if there are more than one) by using the string ‘>>’ and then runs a parser for each one.
| Parameters: | query (str) – query to execute |
|---|