Skip to main content
Version: 1.20.0 (latest)

dlt.destinations.impl.sqlalchemy.load_jobs

build_mysql_adbc_dsn

def build_mysql_adbc_dsn(username: Optional[str] = None,
password: Optional[str] = None,
host: Optional[str] = None,
port: Optional[int] = None,
database: Optional[str] = None,
params: Optional[Dict[str, str]] = None) -> str

View source on GitHub

Build a DSN connection string for the go-mysql ADBC driver.

The go-mysql driver (github.com/go-sql-driver/mysql) has specific DSN format: [username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN]

Based on the driver's source code (dsn.go):

  • Username and password are NOT URL-decoded by the driver
  • Database name IS URL-decoded using url.PathUnescape
  • Query parameter values ARE URL-decoded using url.QueryUnescape

Arguments:

  • username - MySQL username (not URL-encoded)
  • password - MySQL password (not URL-encoded)
  • host - MySQL host
  • port - MySQL port (default: 3306)
  • database - Database/schema name (will be URL-encoded)
  • params - Query parameters (values will be URL-encoded)

Returns:

DSN connection string for go-mysql driver

SqlalchemyParquetADBCJob Objects

class SqlalchemyParquetADBCJob(AdbcParquetCopyJob)

View source on GitHub

ADBC Parquet copy job for SQLAlchemy (sqlite, mysql) with query param handling.

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.