paneer.core documentation

add-column

macro

(add-column command & columns)
Internally used by alter macro

add-column*

(add-column* command & col-options)
Adds a column as part of a ALTER TABLE Command

alter

macro

(alter form)(alter _ tbl-name _ new-name)(alter _ tbl-name [action & args])
Nice wrapper for altering tables. Allows you to write:
(alter
  (table :users :rename-to :lusers))

(alter
  (table :users 
         (add-column (varchar :api-key 255 :not-null))))

(alter 
  (table :users 
          (rename (column :email)
                  (to :shpemail))))

(alter
  (table :users
          (drop-column :email)))

alter*

(alter* & opts)
Starts an ALTER TABLE command

bigint

(bigint command col-name & options)
Creates a bigint column

boolean

(boolean command col-name & options)
Creates a boolean column

column

(column command col-name & [col-type & options])
Adds a column to a command map

create

macro

(create [_ tbl-name & columns])
Allows you to wrap a table definition together as in
(create
  (table :users
         (serial :id :primary-key)
         (varchar :name 255)
         (varchar :email 255)))
then automatically executes it against the current default database.

create*

(create* & opts)
Starts a CREATE TABLE command

create-if-not-exists

macro

(create-if-not-exists [_ tbl-name & columns])
Allows you to wrap a table definitions together as in the create macro, but
includes IF NOT EXISTS in the generated SQL

double

(double command col-name & options)
Creates a double precision column

drop

macro

(drop [_ tbl-name])
Nice wrapper for dropping tables allows you to write:
(drop
  (table :users))
then automatically executes it against the current default database. 

drop*

(drop* & opts)
Starts a DROP TABLE command

drop-column

macro

(drop-column command column-name)
Internally used by alter macro

drop-column*

(drop-column* command col-name)
Specifies column to drop in ALTER TABLE command

drop-if-exists

macro

(drop-if-exists [_ tbl-name])
Nice wrapper for dropping table as in the drop macro

execute

(execute command)
Execute command with the default connection

float

(float command col-name & options)
Creates a Float Column

integer

(integer command col-name & options)
Creates an Integer Column

refer-to

(refer-to command table & [type])
Creates a reference column

rename

macro

(rename command column [_ new-name])
Internally used by alter macro

rename-column-to*

(rename-column-to* command col-name)
Renames a column as part of ALTER TABLE command

rename-to*

(rename-to* command new-table)
Renames table as part of ALTER TABLE command

serial

(serial command col-name & options)
Creates a serial column

sql-string

(sql-string command)
Produces an sql string from command map

table*

(table* command table-name)
Modifyes a command map to include table name

text

(text command col-name & options)
Creates a text column

timestamp

(timestamp command col-name & options)
Creates a timestamp column

varchar

(varchar command col-name length & options)
Creates a Varchar Column

with-connection

(with-connection command conn)
Executes a query with a given connection