Method __builtin.Sql.Connection()->create()


Method create

__builtin.Sql.Connection __builtin.Sql.Connection(string host)
__builtin.Sql.Connection __builtin.Sql.Connection(string host, string db)
__builtin.Sql.Connection __builtin.Sql.Connection(string host, mapping(string:int|string) options)
__builtin.Sql.Connection __builtin.Sql.Connection(string host, string db, string user)
__builtin.Sql.Connection __builtin.Sql.Connection(string host, string db, string user, string password)
__builtin.Sql.Connection __builtin.Sql.Connection(string host, string db, string user, string password, mapping(string:int|string) options)

Description

Create a new SQL connection.

Parameter host
string

Connect to the server specified.

int(0)

Access through a UNIX-domain socket or similar.

Parameter db

Select this database.

Parameter user

User name to access the database as.

Parameter password

Password to access the database.

Parameter options

Optional mapping of options. See the SQL-database documentation for the supported options. (eg Mysql.mysql()->create()).

Note

This function is typically called via Sql.Sql().

Note

Support for options was added in Pike 7.3.

Note

The base class (__builtin.Sql.Connection) only has a prototype.

See also

Sql.Sql()