db
Version agnostic database API module.
This module serves as the import point for functions defined for various versions of the database API. Functions can be imported from this module instead of worrying about handling imports from the various API sub-packages.
import_function(func_name, api_version)
cached
Import a database function from the appropriate API version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
func_name
|
str
|
The name of the function to import. |
required |
api_version
|
int
|
The API version. Currently either 0x000001 or 0x000002. |
required |
Returns:
Name | Type | Description |
---|---|---|
func |
Callable
|
The requested function. |
Raises:
Type | Description |
---|---|
DatabaseError
|
Raised if the api_version is not supported. |
AttributeError
|
Raised if the function requested does not exist. |
Source code in lute/io/db.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
lazy_import(func_name, api_version)
Return a lazily loaded version of the function.
Source code in lute/io/db.py
33 34 35 36 37 38 39 40 |
|