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

  1. host string URL of the psql server. Must start with postgresql://!
  2. username? string Username of the account of the psql server.
  3. password? string Password of the account of the psql server.

Returns

  1. Connection

Or

  1. false If the connection failed.

Types

Connection

Connection object.

Connection.fetch(query)Source

Fetch rows from query.

Parameters

  1. query string The main query of the request. For sanitization, replace any parameters with $n, and pass those arguments after the query.

Returns

  1. table A table of table objects that represent each row of the request.
Connection.fetchrow(query)Source

Fetch the first row from the query.

Parameters

  1. query string The main query of the request. For sanitization, replace any parameters with $n, and pass those arguments after the query.

Returns

  1. table A table that represents the returned row of the request.
Connection.execute(query)Source

Execute a statement and ignore the result..

Parameters

  1. query string The main query of the request. For sanitization, replace any parameters with $n, and pass those arguments after the query.
Connection:close()Source

Close the connection. This makes every function error.