(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
(calculate-line-total quantity unit-price)
Calculate line total: quantity * unit_price
Calculate line total: quantity * unit_price
(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")
(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')
(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"})
(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
(create-record! table-name record)
(create-record! db table-name record)
Alias for write-record! for consistency
Alias for write-record! for consistency
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.
(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'
(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] ...]
(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)
(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")
(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"})
(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
(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"})
(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
(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"})
(format-multivalue value)
Format a multivalue vector back to string for storage
Format a multivalue vector back to string for storage
(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
(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
(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
(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
(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'}
(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.
(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"})
(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.
(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
(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
(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})
(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
(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
(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})
(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})
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |