Liking cljdoc? Tell your friends :D

pickdict.core


calculate-invoice-totalclj

(calculate-invoice-total invoice-id)
(calculate-invoice-total db invoice-id)

Calculate total for an invoice from its detail lines

Calculate total for an invoice from its detail lines
sourceraw docstring

calculate-line-totalclj

(calculate-line-total quantity unit-price)

Calculate line total: quantity * unit_price

Calculate line total: quantity * unit_price
sourceraw docstring

count-recordsclj

(count-records table-name)
(count-records db table-name)

Count records in a table Example: (count-records "PRODUCT")

Count records in a table
Example: (count-records "PRODUCT")
sourceraw docstring

create-dictionary!clj

(create-dictionary! dict-name)
(create-dictionary! db dict-name)

Create a Pick-style dictionary table for a data table. Dictionary entries are stored as multi-value records. Example: (create-dictionary! 'INVOICE_DICT')

Create a Pick-style dictionary table for a data table.
Dictionary entries are stored as multi-value records.
Example: (create-dictionary! 'INVOICE_DICT')
sourceraw docstring

create-file!clj

(create-file! file-name columns)
(create-file! db file-name columns)

Create a table with meaningful column names and its corresponding dictionary. Every table has exactly one dictionary table named {table_name}_DICT. Example: (create-file! "PRODUCT" {:id "INTEGER PRIMARY KEY AUTOINCREMENT" :name "TEXT NOT NULL" :price "REAL"})

Create a table with meaningful column names and its corresponding dictionary.
Every table has exactly one dictionary table named {table_name}_DICT.
Example: (create-file! "PRODUCT" {:id "INTEGER PRIMARY KEY AUTOINCREMENT"
                                    :name "TEXT NOT NULL"
                                    :price "REAL"})
sourceraw docstring

create-invoice-line!clj

(create-invoice-line! invoice-id product-id quantity unit-price)
(create-invoice-line! db invoice-id product-id quantity unit-price)

Create an invoice detail line with automatic line total calculation

Create an invoice detail line with automatic line total calculation
sourceraw docstring

create-record!clj

(create-record! table-name record)
(create-record! db table-name record)

Alias for write-record! for consistency

Alias for write-record! for consistency
sourceraw docstring

default-dbclj

Default SQLite database connection. Users can override this or pass their own db spec to functions.

Default SQLite database connection. Users can override this or pass their own db spec to functions.
sourceraw docstring

define-dictionary-field!clj

(define-dictionary-field! dict-name
                          field-name
                          type
                          position
                          conversion
                          description)
(define-dictionary-field! db
                          dict-name
                          field-name
                          type
                          position
                          conversion
                          description)

Define a field in a Pick-style dictionary using multi-value format. Example: (define-dictionary-field! 'INVOICE_DICT' 'DATE' 'A' '1' 'D' 'Invoice Date') This creates: key='DATE', attributes='A]1]D]Invoice Date'

Define a field in a Pick-style dictionary using multi-value format.
Example: (define-dictionary-field! 'INVOICE_DICT' 'DATE' 'A' '1' 'D' 'Invoice Date')
This creates: key='DATE', attributes='A]1]D]Invoice Date'
sourceraw docstring

define-dictionary-fields!clj

(define-dictionary-fields! dict-name fields)
(define-dictionary-fields! db dict-name fields)

Define multiple dictionary fields at once using Pick multi-value format. attrs should be a vector of vectors: [[field-name type position conversion description] ...]

Define multiple dictionary fields at once using Pick multi-value format.
attrs should be a vector of vectors: [[field-name type position conversion description] ...]
sourceraw docstring

delete-record!clj

(delete-record! table-name id)
(delete-record! db table-name id)

Delete a record from a table by ID Example: (delete-record! "PRODUCT" 1)

Delete a record from a table by ID
Example: (delete-record! "PRODUCT" 1)
sourceraw docstring

drop-table!clj

(drop-table! table)
(drop-table! db table)

Drop a table and its corresponding dictionary table. Every table has exactly one dictionary table named {table_name}_DICT. Example: (drop-table! "PRODUCT")

Drop a table and its corresponding dictionary table.
Every table has exactly one dictionary table named {table_name}_DICT.
Example: (drop-table! "PRODUCT")
sourceraw docstring

exists?clj

(exists? table-name id-or-criteria)
(exists? db table-name id-or-criteria)

Check if a record exists in a table by ID or criteria Example: (exists? "PRODUCT" 1) or (exists? "PRODUCT" {:name "Widget A"})

Check if a record exists in a table by ID or criteria
Example: (exists? "PRODUCT" 1) or (exists? "PRODUCT" {:name "Widget A"})
sourceraw docstring

find-allclj

(find-all table-name)
(find-all db table-name)

Alias for read-all-records-with-dict for consistency - automatically applies dictionary transformations

Alias for read-all-records-with-dict for consistency - automatically applies dictionary transformations
sourceraw docstring

find-byclj

(find-by table-name criteria)
(find-by db table-name criteria)

Find records by criteria from a table Example: (find-by "PRODUCT" {:name "Widget A"})

Find records by criteria from a table
Example: (find-by "PRODUCT" {:name "Widget A"})
sourceraw docstring

find-by-idclj

(find-by-id table-name id)
(find-by-id db table-name id)

Find a record by ID from a table

Find a record by ID from a table
sourceraw docstring

find-firstclj

(find-first table-name criteria)
(find-first db table-name criteria)

Find the first record matching criteria Example: (find-first "PRODUCT" {:name "Widget A"})

Find the first record matching criteria
Example: (find-first "PRODUCT" {:name "Widget A"})
sourceraw docstring

format-multivalueclj

(format-multivalue value)

Format a multivalue vector back to string for storage

Format a multivalue vector back to string for storage
sourceraw docstring

generate-jsonclj

(generate-json v)
source

get-all-dictionary-fieldsclj

(get-all-dictionary-fields dict-name)
(get-all-dictionary-fields db dict-name)

Get all fields in a Pick-style dictionary

Get all fields in a Pick-style dictionary
sourceraw docstring

get-complete-invoiceclj

(get-complete-invoice invoice-id)
(get-complete-invoice db invoice-id)

Get complete invoice with header and all detail lines

Get complete invoice with header and all detail lines
sourceraw docstring

get-dictionary-fieldclj

(get-dictionary-field dict-name field-name)
(get-dictionary-field db dict-name field-name)

Get dictionary field definition from Pick-style dictionary

Get dictionary field definition from Pick-style dictionary
sourceraw docstring

get-table-columnsclj

(get-table-columns table-name)
(get-table-columns db table-name)

Get column names from a table schema

Get column names from a table schema
sourceraw docstring

parse-dictionary-attributesclj

(parse-dictionary-attributes attributes)

Parse multi-value attributes from dictionary entry Returns: {:type 'A', :position '1', :conversion 'D', :description 'Invoice Date'}

Parse multi-value attributes from dictionary entry
Returns: {:type 'A', :position '1', :conversion 'D', :description 'Invoice Date'}
sourceraw docstring

parse-jsonclj

(parse-json v)
source

parse-multivalueclj

(parse-multivalue value)

Parse a multivalue string into a vector of values. Handles both numeric and string values appropriately.

Parse a multivalue string into a vector of values.
Handles both numeric and string values appropriately.
sourceraw docstring

query-recordsclj

(query-records file-name)
(query-records file-name translate-fields)
(query-records db file-name translate-fields)

Query records from a table. Returns data with meaningful column names. Supports translate fields using column names directly. Example: (query-records "INVOICE" {:customer_name "TCUSTOMER;name"})

Query records from a table. Returns data with meaningful column names.
Supports translate fields using column names directly.
Example: (query-records "INVOICE" {:customer_name "TCUSTOMER;name"})
sourceraw docstring

query-with-dictionary-fieldsclj

(query-with-dictionary-fields table-name dict-name)
(query-with-dictionary-fields db table-name dict-name)

Query records using a Pick-style dictionary to define field mappings and translations. This is the TRUE Pick/D3 functionality - dictionary entries are multi-value records.

Query records using a Pick-style dictionary to define field mappings and translations.
This is the TRUE Pick/D3 functionality - dictionary entries are multi-value records.
sourceraw docstring

read-all-recordsclj

(read-all-records file-name)
(read-all-records db file-name)

Read all records from a table and parse multivalue fields into vectors

Read all records from a table and parse multivalue fields into vectors
sourceraw docstring

read-all-records-with-dictclj

(read-all-records-with-dict file-name)
(read-all-records-with-dict db file-name)

Read all records from a table with automatic dictionary transformations if dictionary exists and has entries

Read all records from a table with automatic dictionary transformations if dictionary exists and has entries
sourceraw docstring

save-record!clj

(save-record! table-name record)
(save-record! db table-name record)

Save a record - if it has an ID and exists, update it; otherwise create new Example: (save-record! "PRODUCT" {:name "New Widget" :price 15.99}) (save-record! "PRODUCT" {:id 1 :price 12.99})

Save a record - if it has an ID and exists, update it; otherwise create new
Example: (save-record! "PRODUCT" {:name "New Widget" :price 15.99})
         (save-record! "PRODUCT" {:id 1 :price 12.99})
sourceraw docstring

table-exists?clj

(table-exists? table-name)
(table-exists? db table-name)

Check if a table exists in the database

Check if a table exists in the database
sourceraw docstring

update-invoice-total!clj

(update-invoice-total! invoice-id)
(update-invoice-total! db invoice-id)

Update the total amount for an invoice

Update the total amount for an invoice
sourceraw docstring

update-record!clj

(update-record! table-name id updates)
(update-record! db table-name id updates)

Update a record in a table by ID Example: (update-record! "PRODUCT" 1 {:price 12.99})

Update a record in a table by ID
Example: (update-record! "PRODUCT" 1 {:price 12.99})
sourceraw docstring

write-record!clj

(write-record! file-name record)
(write-record! db file-name record)

Write a record to a table with meaningful column names. Example: (write-record! "PRODUCT" {:name "Widget A" :price 9.95})

Write a record to a table with meaningful column names.
Example: (write-record! "PRODUCT" {:name "Widget A" :price 9.95})
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close