Loom
This class is used to create a loom object that will be use to perform actions to a database.
The following example show how you can create a loom object using this class.
from dataloom import Loom
loom = Loom(
dialect="postgres",
database="hi",
password="root",
user="postgres",
host="localhost",
sql_logger="console",
logs_filename="logs.sql",
port=5432,
)
# OR with connection_uri
loom = Loom(
dialect="mysql",
connection_uri = "mysql://root:root@localhost:3306/hi",
# ...
)
The Loom class takes in the following options
Parameter |
Description |
Value Type |
Default Value |
Required |
|---|---|---|---|---|
|
The connection uri for the specified dialect. |
|
|
|
|
Dialect for the database connection. Options are |
“mysql” or “postgres” or “sqlite” |
|
|
|
Name of the database for |
|
|
|
|
Password for the database user (only for |
|
|
|
|
Database user (only for |
|
|
|
|
Database host (only for |
|
|
|
|
Enable logging for the database queries. If you don’t want to see the sql logs you can set this option to |
|
|
|
|
Filename for the query logs |
|
|
|
|
Port number for the database connection (only for |
|
|
|