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 string URL of the psql server. Must start with
postgresql://
! - username? string Username of the account of the psql server.
- password? string Password of the account of the psql server.
Returns
Or
- false If the connection failed.
- host string URL of the psql server. Must start with
Types
Connection
Connection object.
- Connection.fetch(query)Source
Fetch rows from query.
Parameters
- query string The main query of the request. For sanitization, replace any parameters with
$n
, and pass those arguments after the query.
Returns
- table A table of table objects that represent each row of the request.
- query string The main query of the request. For sanitization, replace any parameters with
- Connection.fetchrow(query)Source
Fetch the first row from the query.
Parameters
- query string The main query of the request. For sanitization, replace any parameters with
$n
, and pass those arguments after the query.
Returns
- table A table that represents the returned row of the request.
- query string The main query of the request. For sanitization, replace any parameters with
- Connection.execute(query)Source
Execute a statement and ignore the result..
Parameters
- query string The main query of the request. For sanitization, replace any parameters with
$n
, and pass those arguments after the query.
- query string The main query of the request. For sanitization, replace any parameters with
- Connection:close()Source
Close the connection. This makes every function error.