Skip to main content

Connect to Database

Command description

Connect to a database before executing SQL. The command supports MySQL, PostgreSQL, SQLite, Oracle, and SQL Server. No additional database driver installation is required. For a remote database, ensure that the database server accepts remote connections.

Command Input Parameters

input parametersInput parameter typeDescription
TypeenumMySQL, PostgreSQL, SQLite, Oracle, SQL Server
Usernamestr
Passwordstr
hoststrDatabase server hostname or IP address
Portint or str
NamestrDatabase name or service name
Encodingstr
PathstrDatabase file path; required only when Type is SQLite

Command Output Parameters

Output parametersOutput parameter typeDescription
SQL Connection ObjectSQLConnection

Default port number:

  • MySQL 3306
  • PostgreSQL 5432
  • Oracle 1521
  • SQL Server 1433