ccsql
An API that connects to the ccsql server and allows requests.
| open(host [, username [, password]]) | Opens a connection to the requested Postgresql server. |
|---|
- open(host [, username [, password]])Source
Opens a connection to the requested Postgresql server.
Parameters
- host
stringURL of the psql server. Must start withpostgresql://! - username?
stringUsername of the account of the psql server. - password?
stringPassword of the account of the psql server.
Returns
Or
- false If the connection failed.
- host
Types
Connection
Connection object.
- Connection.fetch(query)Source
Fetch rows from query.
Parameters
- query
stringThe main query of the request. For sanitization, replace any parameters with$n, and pass those arguments after the query.
Returns
tableA table of table objects that represent each row of the request.
- query
- Connection.fetchrow(query)Source
Fetch the first row from the query.
Parameters
- query
stringThe main query of the request. For sanitization, replace any parameters with$n, and pass those arguments after the query.
Returns
tableA table that represents the returned row of the request.
- query
- Connection.execute(query)Source
Execute a statement and ignore the result..
Parameters
- query
stringThe main query of the request. For sanitization, replace any parameters with$n, and pass those arguments after the query.
- query
- Connection:close()Source
Close the connection. This makes every function error.