Documentation ¶
Index ¶
Constants ¶
View Source
const ( // POSTGRES_SCHEMA_QUERY is the SQL query used to describe a table schema in PostgreSQL. POSTGRES_SCHEMA_QUERY = "SELECT column_name, data_type, character_maximum_length FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = %s;" // POSTGRES_TABLE_LIST_QUERY is the SQL query used to list all tables in a schema in PostgreSQL. POSTGRES_TABLE_LIST_QUERY = "SELECT table_name FROM information_schema.tables WHERE table_schema= %s AND table_type='BASE TABLE';" )
Variables ¶
View Source
var DB_PASSWORD = "DB_PASSWORD"
DB_PASSWORD is the environment variable that holds the database password.
Functions ¶
func NewPostgres ¶
NewPostgres creates a new PostgreSQL client with the given sql.DB.
Types ¶
type Postgres ¶
Postgres is a PostgreSQL implementation of the ISQL interface.
func (*Postgres) Execute ¶
Execute executes a SQL query and returns the result as a JSON byte slice. It returns an error if the SQL query fails.
Click to show internal directories.
Click to hide internal directories.