MCPcopy
hub / github.com/Dataherald/dataherald / from_uri

Method from_uri

dataherald/sql_database/base.py:57–66  ·  view source on GitHub ↗

Construct a SQLAlchemy engine from URI.

(
        cls, database_uri: str, engine_args: dict | None = None
    )

Source from the content-addressed store, hash-verified

55
56 @classmethod
57 def from_uri(
58 cls, database_uri: str, engine_args: dict | None = None
59 ) -> "SQLDatabase":
60 """Construct a SQLAlchemy engine from URI."""
61 _engine_args = engine_args or {}
62 if database_uri.lower().startswith("duckdb"):
63 config = {"autoload_known_extensions": False}
64 _engine_args["connect_args"] = {"config": config}
65 engine = create_engine(database_uri, **_engine_args)
66 return cls(engine)
67
68 @classmethod
69 def get_sql_engine(

Callers 2

get_sql_engineMethod · 0.80
from_uri_sshMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected