[Top]
predef::
Sql
Sql.Sql
|
Method Sql.Sql()->create()
- Method
create
-
void Sql.Sql()
void Sql.Sql(string host)
void Sql.Sql(string host, string db)
void Sql.Sql(string host, mapping(string:int|string) options)
void Sql.Sql(string host, string db, string user)
void Sql.Sql(string host, string db, string user, string password)
void Sql.Sql(string host, string db, string user, string password, mapping(string:int|string) options)
void Sql.Sql(object host)
void Sql.Sql(object host, string db)
- Description
-
Create a new generic SQL object.
- Parameter host
-
object | Use this object to access the SQL-database.
|
string | Connect to the server specified.
The string should be on the format:
dbtype://[user[:password]@]hostname[:port][/database]
Use the dbtype protocol to connect to the database server
on the specified host.
If the hostname is "", access through a UNIX-domain
socket or similar, e g "mysql://root@:/tmp/mysql.sock/"
|
int(0..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
-
In versions of Pike prior to 7.2 it was possible to leave out the
dbtype, but that has been deprecated, since it never worked well.
- Note
-
Support for options was added in Pike 7.3.
|