This is the clsql-helper Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:42:59 2024 GMT+0.
clsql-helper/clsql-helper.asd
clsql-helper/package.lisp
clsql-helper/utils.lisp
clsql-helper/iterate-clauses.lisp
clsql-helper/connections.lisp
clsql-helper/date.lisp
clsql-helper/clsql.lisp
clsql-helper/db-object.lisp
clsql-helper/dirty.lisp
clsql-helper/migrations.lisp
clsql-helper/merge.lisp
clsql-helper/recency.lisp
The main system appears first, followed by any subsystem dependency.
clsql-helper
A library providing a clutch of utilities to make working with clsql easier
BSD
0.1
iterate
(system).
clsql
(system).
closer-mop
(system).
cl-ppcre
(system).
cl-interpol
(system).
symbol-munger
(system).
alexandria
(system).
md5
(system).
access
(system).
collectors
(system).
package.lisp
(file).
utils.lisp
(file).
iterate-clauses.lisp
(file).
connections.lisp
(file).
date.lisp
(file).
clsql.lisp
(file).
db-object.lisp
(file).
dirty.lisp
(file).
migrations.lisp
(file).
merge.lisp
(file).
recency.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
clsql-helper/clsql-helper.asd
clsql-helper/package.lisp
clsql-helper/utils.lisp
clsql-helper/iterate-clauses.lisp
clsql-helper/connections.lisp
clsql-helper/date.lisp
clsql-helper/clsql.lisp
clsql-helper/db-object.lisp
clsql-helper/dirty.lisp
clsql-helper/migrations.lisp
clsql-helper/merge.lisp
clsql-helper/recency.lisp
clsql-helper/clsql-helper.asd
clsql-helper
(system).
clsql-helper/utils.lisp
package.lisp
(file).
clsql-helper
(system).
*command-log-stream*
(special variable).
*connection-settings*
(special variable).
+a-day+
(special variable).
+a-minute+
(special variable).
+a-month+
(special variable).
+a-negative-day+
(special variable).
+a-negative-hour+
(special variable).
+a-negative-minute+
(special variable).
+a-negative-month+
(special variable).
+a-negative-second+
(special variable).
+a-negative-year+
(special variable).
+a-second+
(special variable).
+a-year+
(special variable).
+an-hour+
(special variable).
*clsql-codebase-loaded*
(special variable).
*default-log-fn*
(special variable).
*record-this-dirty-slot*
(special variable).
+common-white-space-trimbag+
(special variable).
relaxed-parse-float
(generic function).
trim-and-nullify
(function).
trim-whitespace
(function).
clsql-helper/iterate-clauses.lisp
utils.lisp
(file).
clsql-helper
(system).
%coerce-to-step
(generic function).
%date-test-fn-finder
(function).
%date-test-form
(function).
clause-for-from-date-1
(function).
clause-for-from-date-thru-5
(function).
clause-for-from-date-to-3
(function).
clause-for-from-datetime-2
(function).
clause-for-from-datetime-thru-6
(function).
clause-for-from-datetime-to-4
(function).
clsql-helper/connections.lisp
iterate-clauses.lisp
(file).
clsql-helper
(system).
*connection-database*
(special variable).
add-connection-spec
(function).
find-active-connection-name
(function).
find-any-active-connection-name
(function).
find-any-connection
(function).
find-connection
(function).
get-connection-spec
(function).
new-connection-database
(function).
print-object
(method).
remove-connection-spec
(function).
with-a-database
(macro).
with-a-database-context
(function).
with-a-transaction
(macro).
with-a-transaction-context
(function).
with-database
(macro).
with-database-context
(function).
with-database-function
(function).
with-transaction-context
(function).
%call-perhaps-logged
(function).
*inner-transaction-error*
(special variable).
*thread-local-transaction-catch-tag*
(special variable).
coerce-connection-spec
(function).
commit
(condition).
connection-database
(class).
maybe-call
(function).
names->conn
(reader method).
(setf names->conn)
(writer method).
names->spec
(reader method).
(setf names->spec)
(writer method).
rollback
(condition).
same-database-connection?
(function).
clsql-helper/date.lisp
connections.lisp
(file).
clsql-helper
(system).
after-day-of-month
(function).
before-day-of-month
(function).
clsql-date/times->utime
(function).
clsql-datetime-equal
(function).
convert-to-clsql-date
(generic function).
convert-to-clsql-date!
(macro).
convert-to-clsql-datetime
(generic function).
convert-to-clsql-datetime!
(macro).
current-sql-date
(function).
current-sql-time
(function).
date-add
(function).
date-day
(generic function).
date-diff
(function).
date-month
(generic function).
date-year
(generic function).
day-after
(function).
day-before
(function).
days-in-month
(function).
dt<
(function).
dt<=
(function).
dt>
(function).
dt>=
(function).
first-of-next-month
(function).
first-of-the-month
(function).
first-of-the-month?
(function).
iso8601-datestamp
(generic function).
iso8601-timestamp
(generic function).
last-month
(function).
last-of-the-month
(function).
last-of-the-month?
(function).
month-day-string
(function).
month-string
(function).
next-month
(function).
print-nullable-date
(function).
print-nullable-datetime
(function).
print-timestamp
(function).
*iso8601-date-separator*
(special variable).
*iso8601-date-time-separator*
(special variable).
*iso8601-microseconds*
(special variable).
*iso8601-time-separator*
(special variable).
*iso8601-timezone*
(special variable).
+date-sep+
(special variable).
+date-time-regex+
(special variable).
+iso-8601-ish-regex+
(special variable).
+iso-8601-ish-regex-string+
(special variable).
clsql-helper/clsql.lisp
date.lisp
(file).
clsql-helper
(system).
by-col
(generic function).
by-id
(generic function).
clsql-and
(function).
clsql-ands
(function).
clsql-column-name
(function).
clsql-exp
(function).
clsql-get-val
(function).
clsql-or
(function).
clsql-ors
(function).
coerce-value-to-db-type
(method).
column-name-string
(function).
db-eql
(generic function).
db-exec
(function).
db-null
(function).
db-null!
(macro).
db-objs
(function).
db-objs-select
(function).
db-query
(function).
db-query-plists
(function).
db-scalar
(function).
db-select
(function).
db-select-first
(function).
db-select-scalar
(function).
db-string
(function).
db-type-from-lisp-type
(function).
format-value-for-database
(function).
identity-slot?
(method).
join-slot?
(function).
list-of-db-strings
(function).
log-database-command
(macro).
make-instance-plist
(function).
make-instances
(function).
make-instances-setting-access
(function).
make-instances-setting-accessors
(function).
new-object-p
(generic function).
pretty-print-sql
(function).
primary-key-column-names
(function).
primary-key-slot
(function).
primary-key-slot-names
(function).
primary-key-slots
(function).
primary-key-value
(function).
primary-key-where-clauses
(function).
save!
(generic function).
save-failed
(condition).
table-name-exp
(function).
table-name-string
(function).
type-coercion-error
(function).
type-coercion-error
(condition).
with-command-logging
(macro).
with-command-logging-to-string
(macro).
%clsql-subclauses
(function).
%coerce-rows
(function).
%command-if-needed
(function).
%log-fn-perhaps
(function).
coerce-to-db-string-representation
(generic function).
db-object-has-no-keys
(condition).
db-object-key-slots
(generic function).
default-log-fn
(function).
error-db-obj-has-no-keys
(function).
log-database-command-fn
(function).
make-instances-setting-slot-values
(function).
message
(reader method).
message
(reader method).
(setf message)
(writer method).
(setf message)
(writer method).
obj
(reader method).
(setf obj)
(writer method).
string-to-boolean
(function).
to-type
(reader method).
(setf to-type)
(writer method).
val
(reader method).
(setf val)
(writer method).
warn-db-obj-has-no-keys
(function).
clsql-helper/db-object.lisp
clsql.lisp
(file).
clsql-helper
(system).
db-object
(class).
fill-identifier!
(method).
has-db-data-to-store?
(function).
mssql-db-object
(class).
next-identifier
(method).
next-identifier-sql
(generic function).
pg-db-object
(class).
slot-db-stored?
(function).
(setf slot-value-using-class)
(method).
sqlite3-db-object
(class).
update-record-from-slots
(method).
update-record-from-slots
(method).
update-records-from-instance
(method).
choose-database-for-instance
(method).
mssql-db-view
(class).
clsql-helper/dirty.lisp
db-object.lisp
(file).
clsql-helper
(system).
dirty-db-slots-mixin
(class).
dirty-slots
(reader method).
(setf dirty-slots)
(writer method).
dirty-test
(reader method).
(setf dirty-test)
(writer method).
fill-identifier!
(method).
find-dirty-test
(function).
initialize-instance
(method).
print-object
(method).
slot-dirty?
(generic function).
(setf slot-value-using-class)
(method).
update-instance-from-records
(method).
%dirty-before
(function).
defmethod-when-possible
(macro).
dirty-slot
(class).
get-slot-values-from-view
(method).
make-dirty-slot
(function).
new-value
(reader method).
(setf new-value)
(writer method).
old-value
(reader method).
(setf old-value)
(writer method).
reset-dirty
(function).
slot-name
(reader method).
(setf slot-name)
(writer method).
update-slot-from-db-value
(method).
view-classes-and-storable-slots
(method).
clsql-helper/migrations.lisp
dirty.lisp
(file).
clsql-helper
(system).
*migration-table-name*
(special variable).
initialize-instance
(method).
migrations
(method).
%default-migrations
(function).
%migration-done-p
(function).
%sql-hash
(function).
command
(reader method).
ensure-migration-table
(function).
hash
(reader method).
md5-string
(function).
migrate
(generic function).
migration
(class).
migration-done-p
(reader method).
to-migrations
(generic function).
clsql-helper/merge.lisp
migrations.lisp
(file).
clsql-helper
(system).
copy-instance
(generic function).
merge-changes
(method).
merge-conflict
(condition).
merge-conflicts
(condition).
merging-values
(condition).
*default-object-diff-ignore-list*
(special variable).
already-saved
(reader method).
(setf already-saved)
(writer method).
conflicts
(reader method).
(setf conflicts)
(writer method).
from
(reader method).
(setf from)
(writer method).
object-diff-equals
(method).
object-diff-list
(method).
old-value
(reader method).
(setf old-value)
(writer method).
pending-value
(reader method).
(setf pending-value)
(writer method).
saved-value
(reader method).
(setf saved-value)
(writer method).
slot
(reader method).
slot
(reader method).
(setf slot)
(writer method).
(setf slot)
(writer method).
target
(reader method).
(setf target)
(writer method).
value
(reader method).
(setf value)
(writer method).
clsql-helper/recency.lisp
merge.lisp
(file).
clsql-helper
(system).
%retrieved-at
(reader method).
(setf %retrieved-at)
(writer method).
current-timestamp
(function).
filter-select-list
(method).
recency-error
(condition).
recency-mixin
(class).
save!
(method).
update-record-from-slots
(method).
update-record-from-slots
(method).
update-records-from-instance
(method).
update-records-from-instance
(method).
%after-update-recency-check
(function).
%before-update-recency-check
(function).
%history-select-fn
(reader method).
(setf %history-select-fn)
(writer method).
current-timestamp-sql
(function).
get-history-info
(generic function).
history-info
(reader method).
(setf history-info)
(writer method).
instance
(reader method).
(setf instance)
(writer method).
most-recent-history-date
(function).
validate-recency
(generic function).
Packages are listed by definition order.
clsql-helper
common-lisp
.
common-lisp-user
.
iterate
.
%retrieved-at
(generic reader).
(setf %retrieved-at)
(generic writer).
*command-log-stream*
(special variable).
*connection-database*
(special variable).
*connection-settings*
(special variable).
*migration-table-name*
(special variable).
+a-day+
(special variable).
+a-minute+
(special variable).
+a-month+
(special variable).
+a-negative-day+
(special variable).
+a-negative-hour+
(special variable).
+a-negative-minute+
(special variable).
+a-negative-month+
(special variable).
+a-negative-second+
(special variable).
+a-negative-year+
(special variable).
+a-second+
(special variable).
+a-year+
(special variable).
+an-hour+
(special variable).
add-connection-spec
(function).
after-day-of-month
(function).
before-day-of-month
(function).
by-col
(generic function).
by-id
(generic function).
clsql-and
(function).
clsql-ands
(function).
clsql-column-name
(function).
clsql-date/times->utime
(function).
clsql-datetime-equal
(function).
clsql-exp
(function).
clsql-get-val
(function).
clsql-or
(function).
clsql-ors
(function).
coerce-value-to-db-type
(generic function).
column-name-string
(function).
convert-to-clsql-date
(generic function).
convert-to-clsql-date!
(macro).
convert-to-clsql-datetime
(generic function).
convert-to-clsql-datetime!
(macro).
copy-instance
(generic function).
current-sql-date
(function).
current-sql-time
(function).
current-timestamp
(function).
date-add
(function).
date-day
(generic function).
date-diff
(function).
date-month
(generic function).
date-year
(generic function).
day-after
(function).
day-before
(function).
days-in-month
(function).
db-eql
(generic function).
db-exec
(function).
db-null
(function).
db-null!
(macro).
db-object
(class).
db-objs
(function).
db-objs-select
(function).
db-query
(function).
db-query-plists
(function).
db-scalar
(function).
db-select
(function).
db-select-first
(function).
db-select-scalar
(function).
db-string
(function).
db-type-from-lisp-type
(function).
dirty-db-slots-mixin
(class).
dirty-slots
(generic reader).
(setf dirty-slots)
(generic writer).
dirty-test
(generic reader).
(setf dirty-test)
(generic writer).
dt<
(function).
dt<=
(function).
dt>
(function).
dt>=
(function).
fill-identifier!
(generic function).
find-active-connection-name
(function).
find-any-active-connection-name
(function).
find-any-connection
(function).
find-connection
(function).
find-dirty-test
(function).
first-of-next-month
(function).
first-of-the-month
(function).
first-of-the-month?
(function).
format-value-for-database
(function).
get-connection-spec
(function).
has-db-data-to-store?
(function).
identity-slot?
(generic function).
iso8601-datestamp
(generic function).
iso8601-timestamp
(generic function).
join-slot?
(function).
last-month
(function).
last-of-the-month
(function).
last-of-the-month?
(function).
list-of-db-strings
(function).
log-database-command
(macro).
make-instance-plist
(function).
make-instances
(function).
make-instances-setting-access
(function).
make-instances-setting-accessors
(function).
merge-changes
(generic function).
merge-conflict
(condition).
merge-conflicts
(condition).
merging-values
(condition).
migrations
(generic function).
month-day-string
(function).
month-string
(function).
mssql-db-object
(class).
new-connection-database
(function).
new-object-p
(generic function).
next-identifier
(generic function).
next-identifier-sql
(generic function).
next-month
(function).
pg-db-object
(class).
pretty-print-sql
(function).
primary-key-column-names
(function).
primary-key-slot
(function).
primary-key-slot-names
(function).
primary-key-slots
(function).
primary-key-value
(function).
primary-key-where-clauses
(function).
print-nullable-date
(function).
print-nullable-datetime
(function).
print-timestamp
(function).
recency-error
(condition).
recency-mixin
(class).
remove-connection-spec
(function).
save!
(generic function).
save-failed
(condition).
slot-db-stored?
(function).
slot-dirty?
(generic function).
sqlite3-db-object
(class).
table-name-exp
(function).
table-name-string
(function).
type-coercion-error
(function).
type-coercion-error
(condition).
with-a-database
(macro).
with-a-database-context
(function).
with-a-transaction
(macro).
with-a-transaction-context
(function).
with-command-logging
(macro).
with-command-logging-to-string
(macro).
with-database
(macro).
with-database-context
(function).
with-database-function
(function).
with-transaction-context
(function).
%after-update-recency-check
(function).
%before-update-recency-check
(function).
%call-perhaps-logged
(function).
%clsql-subclauses
(function).
%coerce-rows
(function).
%coerce-to-step
(generic function).
%command-if-needed
(function).
%date-test-fn-finder
(function).
%date-test-form
(function).
%default-migrations
(function).
%dirty-before
(function).
%history-select-fn
(generic reader).
(setf %history-select-fn)
(generic writer).
%log-fn-perhaps
(function).
%migration-done-p
(function).
%sql-hash
(function).
*clsql-codebase-loaded*
(special variable).
*default-log-fn*
(special variable).
*default-object-diff-ignore-list*
(special variable).
*inner-transaction-error*
(special variable).
*iso8601-date-separator*
(special variable).
*iso8601-date-time-separator*
(special variable).
*iso8601-microseconds*
(special variable).
*iso8601-time-separator*
(special variable).
*iso8601-timezone*
(special variable).
*record-this-dirty-slot*
(special variable).
*thread-local-transaction-catch-tag*
(special variable).
+common-white-space-trimbag+
(special variable).
+date-sep+
(special variable).
+date-time-regex+
(special variable).
+iso-8601-ish-regex+
(special variable).
+iso-8601-ish-regex-string+
(special variable).
already-saved
(generic reader).
(setf already-saved)
(generic writer).
clause-for-from-date-1
(function).
clause-for-from-date-thru-5
(function).
clause-for-from-date-to-3
(function).
clause-for-from-datetime-2
(function).
clause-for-from-datetime-thru-6
(function).
clause-for-from-datetime-to-4
(function).
coerce-connection-spec
(function).
coerce-to-db-string-representation
(generic function).
command
(generic reader).
commit
(condition).
conflicts
(generic reader).
(setf conflicts)
(generic writer).
connection-database
(class).
current-timestamp-sql
(function).
db-object-has-no-keys
(condition).
db-object-key-slots
(generic function).
default-log-fn
(function).
defmethod-when-possible
(macro).
dirty-slot
(class).
ensure-migration-table
(function).
error-db-obj-has-no-keys
(function).
from
(generic reader).
(setf from)
(generic writer).
get-history-info
(generic function).
hash
(generic reader).
history-info
(generic reader).
(setf history-info)
(generic writer).
instance
(generic reader).
(setf instance)
(generic writer).
log-database-command-fn
(function).
make-dirty-slot
(function).
make-instances-setting-slot-values
(function).
maybe-call
(function).
md5-string
(function).
message
(generic reader).
(setf message)
(generic writer).
migrate
(generic function).
migration
(class).
migration-done-p
(generic reader).
most-recent-history-date
(function).
mssql-db-view
(class).
names->conn
(generic reader).
(setf names->conn)
(generic writer).
names->spec
(generic reader).
(setf names->spec)
(generic writer).
new-value
(generic reader).
(setf new-value)
(generic writer).
obj
(generic reader).
(setf obj)
(generic writer).
object-diff-equals
(generic function).
object-diff-list
(generic function).
old-value
(generic reader).
(setf old-value)
(generic writer).
pending-value
(generic reader).
(setf pending-value)
(generic writer).
relaxed-parse-float
(generic function).
reset-dirty
(function).
rollback
(condition).
same-database-connection?
(function).
saved-value
(generic reader).
(setf saved-value)
(generic writer).
slot
(generic reader).
(setf slot)
(generic writer).
slot-name
(generic reader).
(setf slot-name)
(generic writer).
string-to-boolean
(function).
target
(generic reader).
(setf target)
(generic writer).
to-migrations
(generic function).
to-type
(generic reader).
(setf to-type)
(generic writer).
trim-and-nullify
(function).
trim-whitespace
(function).
val
(generic reader).
(setf val)
(generic writer).
validate-recency
(generic function).
value
(generic reader).
(setf value)
(generic writer).
warn-db-obj-has-no-keys
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
a stream that we will record sql commands to in the body of
A variable that when bound to a connection-database object will look up
the table name to use for migrations
MUST BE Inside a database connection, creates a lexical scope in which all sql commands
executed on this connection are logged to a specific logger
tries to format such that it will be readable in the log
log-fn-name is a function/macro name that will be called with a string/array as
(log-fn-name stuff)
If a database connection exists and it matches the passed in settings or the passed in settings are null, use it!, otherwise aquire a new database connection
Wrapper around clsql:with-transaction, when a rollback is issued the code
escapes (throw) to the outermost with-a-transaction.
without the catch, its possible for an error handler in an intermediate function
record commands to the *command-log-stream* for the duration of body then restore its previous binding
Log the sql commands of the body to a string
opens a database connection and executes the body
connect-settings: a plist of connection info for clsql, also supports :post-connect-fn, a function to run after opening the connection
post-connect-fn: a function of no arguments to run after opening the connection
Are we past a specific day of the month
Are we past a specific day of the month
returns a CLSQL:SQL-AND for all non-nil clauses, no nil if there are no non-nil clauses
obj is either a wall-time or a date in local time. Converts to UTC and returns a utime.
pass timezone nil to skip UTC conversion.
if you are looking for the other it is clsql-sys:utime->time
Tries to handle full datetime equality reguardless of the format (string datestamp, date, datetime, utime)
alias of get-scalar
returns a CLSQL:SQL-AND for all non-nil clauses, no nil if there are no non-nil clauses
returns a CLSQL:SQL-AND for all non-nil clauses, no nil if there are no non-nil clauses
current date
current date and time
Gets the difference in days between two dates
returns a negative number to indicate that d1 is after d2
returns a positive number to indicate that d2 is after d1
Return the number of days in the month of the date passed in
Returns a value or the string null
retrieve objects of type class from the database using db-query
runs a db query
sets :flatp to t
if params are provided we build a command object
(backend better support this)
Returns a list of plists that correspond to the query results
Query a single value from the database
Runs a clsql:select
defaulting to :flatp T
unnests any lists as part of the select list
query a single row / value from the database using clsql:select
alias with db-select-scalar
query a single row / value from the database using clsql:select
alias with db-select-first which was deemed more aptly named when selecting a row
trims, nullifies, escapes and wraps in single quotes so that the string is ready to be spliced into a query (eg: with cl-interpol). returns ’foo’ or NIL.
returns the first of the month for the month/year of the date passed in
returns whether or not the date passed in is the first of the month
prints a correctly sql escaped value for postgres
Returns the first of next month eg: 2/14/2012->2/29/2012
Returns T if its the last day of the month
For use in creating ‘column IN (${stuff})‘ type of clauses
Creates a plist intended to be passed to make-instance
From N rows and some column-names make N instances of class filling data from rows using make instance
From N rows and column-name make N instances of class filling data from rows by creating instances and setting through access lib
From N rows and column-name make N instances of class filling data from rows by creating instances and setting existing accessor functions
prints dates as January 3
Converts the date to the full name, January, February,etc
Generates a where clause based on all of the primary keys of the object
ex: pk1 = val1 and pk2 = val2 ...
if the date exists, prints m?m/d?d/yyyy
if the date exists, prints mm/dd/yyyy hh:mm:ss
if the date exists, prints yyyy-mm-dd hh:mm:ss.uuuuuu
based on what is passed in, tries to figure out what the table name is
If a database connection exists and it matches the passed in settings or the passed in settings are null, use it!, otherwise aquire a new database connection
Either establish a new transaction context (with-transaction-context) or run the body in the extisting transaction context
opens a database connection with the given settings, and runs the function.
connect-settings: a plist of connection info for clsql, also supports :post-connect-fn, a function to run after opening the connection
post-connect-fn: a function of no arguments to run after opening the connection
Alias of with-database-context for backwards compatability
Creates a context inside which *default-database* is bound and runs the fn
inside it
Establish a context for enlisting in transactions and run the body in a new transaction
recency-mixin
)) ¶recency-mixin
)) ¶The Server time this was retrieved from the database
Named this way to reduce conflict likely hood with database columns
fetchs the first row for the given class by id
Fetchs the first row for the given class by id
direct implementation of by-id, (select class). fetchs the first row for the given class by id
Coerces a value to the correct db-type
if the conversion fails signals a continueable type-coercion-error
(use-value is also available)
returns (values val coerced?)
the coerced value and whether or not a coersion took place
Convert your value into a clsql:date structure
Converts a string timestamp into a clsql date time object
Makes every possible effort to understand your date that will invariably be in some format it wont understand.
Makes a copy of an instance via allocate instance then copies all
slot-values and calls reinitialize-instance
Given an object that encodes a date, return the day component
Given an object that encodes a date, return the month component
Given an object that encodes a date, return the year component
Tries to determine if the objects are of the same type and have the same primary key values
Many times objects which pass new-objectp are db-eql ,but once saved are no longer db-eql (due to using serial pkey)
dirty-db-slots-mixin
)) ¶automatically generated reader method
dirty-db-slots-mixin
)) ¶automatically generated writer method
dirty-db-slots-mixin
)) ¶automatically generated reader method
dirty-db-slots-mixin
)) ¶automatically generated writer method
dirty-db-slots-mixin
) &key database) ¶fill the id field on the object with the appropriate next-identifier
Given an object that encodes a date
return an iso8601-datestamp representation of it
CLSQL has a function (I wrote) to do this, but I wanted more flexibility in output
so that I could use this in more situations
clsql:iso-timestamp is used only to write to database backends, so a very strict ISO
is fine
run ‘sql-statements‘ on the database once and only once. ‘sql-statements‘ can be strings, pathnames, or lists.
Checks that primary keys have values and that the object with those primary key values exists in the database
fetch the next unique identifier for this obj/database, usually the value of a autoincrement field.
returns the SQL query to run to get the next identifier. Query should return 1 row with 1 column.
sqlite3-db-object
) &key database) ¶fetch most recent AUTOINCREMENT on this connection. https://www.sqlite.org/lang_corefunc.html#last_insert_rowid
mssql-db-object
) &key database) ¶use SCOPE_IDENTITY
pg-db-object
) &key database) ¶pull the sequence value for this object’s table
saves the given object, then returns the saved object
recency-mixin
) &key original &allow-other-keys) ¶determines whether or not a slot on a given object is dirty
slot-name can be a list and all? determines if we want to not if all of
them or dirty or if any of them are dirty
dirty-db-slots-mixin
) slot-name &key all?) ¶recency-mixin
) (sl select-list
) database) ¶clsql-sys
.
dirty-db-slots-mixin
) &key &allow-other-keys) ¶dirty-slot
) s) ¶Print the auto-print-items for this instance.
connection-database
) stream) ¶standard-db-class
) (object dirty-db-slots-mixin
) (slot standard-effective-slot-definition
)) ¶sb-mop
.
standard-db-class
) (object db-object
) (slot standard-effective-slot-definition
)) ¶sb-mop
.
dirty-db-slots-mixin
) &key &allow-other-keys) ¶clsql-sys
.
recency-mixin
) slots &key database &allow-other-keys) ¶clsql-sys
.
recency-mixin
) slots &key database &allow-other-keys) ¶clsql-sys
.
db-object
) slots &key database) ¶After effecting the database record, fill the identifier field
clsql-sys
.
mssql-db-view
) slots &key &allow-other-keys) ¶By default views shouldn’t be updatable, so specialize a method to signal an error.
clsql-sys
.
recency-mixin
) &key database &allow-other-keys) ¶clsql-sys
.
recency-mixin
) &key database &allow-other-keys) ¶clsql-sys
.
db-object
) &key database) ¶After effecting the database record, if the key-slot is empty then use SCOPE_IDENTITY to fill it. If > 1 key-slot, this won’t do anything.
clsql-sys
.
error
.
The object that was saved while we were working
(quote nil)
:already-saved
(quote nil)
:old-value
(quote nil)
:saved-value
(quote nil)
:pending-value
error
.
(quote nil)
:conflicts
condition
.
(quote nil)
:target
(quote nil)
:value
error
.
:message
standard-db-object
.
The Server time this was retrieved from the database
Named this way to reduce conflict likely hood with database columns
(or null clsql-sys:wall-time)
:%retrieved-at
a function that returns history data about an object the
first returned value MUST be the most recent time the object was saved in
the database
:%history-select-fn
Variable to hold conditions from internal errors, just makes for a bit cleaner code I think.
Should we record this slot as dirty?
Variable to hold the gensymed catch tag this thread’s with-a-transaction is using.
These are migrations necessary to making the system work as it upgrades
returns non-nil if this hashed migration has been run
returns a hashed form of the query, as a string
iterates through dates from start by step
HAS NO END CHECK eg an infinite loop unless you prevent it
iterates through dates from start to end inclusively
iterates through dates from start to end exclusive of end
iterates through dates from start by step
HAS NO END CHECK eg an infinite loop unless you prevent it
iterates through dates from start to end inclusively
iterates through dates from start to end exclusive of end
if it doesn’t exist, create the migration table
From N rows and column-name make N instances of class filling data from rows by creating instances and setting slot-values
determines whether or not two connections are the same
by comparing their connection spec (eg ’(server db user pass))
handles connection-settings, connection-specs and clsql:database
convert a string to a boolean value
trims the whitespace from a string returning nil
if trimming produces an empty string or the string ’nil’
Converts something in an iterate date iteration clause BY section to a valid clsql:duration if it can
recency-mixin
)) ¶recency-mixin
)) ¶a function that returns history data about an object the
first returned value MUST be the most recent time the object was saved in
the database
merge-conflict
)) ¶merge-conflict
)) ¶Convert an object into an unquoted string that the database understands
mostly used to do the coercion in db-string
merge-conflicts
)) ¶merge-conflicts
)) ¶returns the primarky key-slots of the given object
merging-values
)) ¶merging-values
)) ¶from
.
recency-mixin
)) ¶recency-error
)) ¶recency-error
)) ¶recency-error
)) ¶recency-error
)) ¶type-coercion-error
)) ¶type-coercion-error
)) ¶save-failed
)) ¶save-failed
)) ¶perform the migration, returns the number of statments executed
connection-database
)) ¶connection-database
)) ¶A mapping of names to active connections
connection-database
)) ¶connection-database
)) ¶A mapping of names to connection specs
dirty-slot
)) ¶automatically generated reader method
dirty-slot
)) ¶automatically generated writer method
db-object-has-no-keys
)) ¶db-object-has-no-keys
)) ¶obj
.
merge-conflict
)) ¶dirty-slot
)) ¶automatically generated reader method
merge-conflict
)) ¶dirty-slot
)) ¶automatically generated writer method
merge-conflict
)) ¶merge-conflict
)) ¶trys to read a value we hope to be a floating point number returns nil on failure
The goal is to allow reading strings with spaces commas and dollar signs in them correctly
merge-conflict
)) ¶merge-conflict
)) ¶merge-conflict
)) ¶merge-conflict
)) ¶slot
.
merging-values
)) ¶merging-values
)) ¶slot
.
dirty-slot
)) ¶automatically generated reader method
dirty-slot
)) ¶automatically generated writer method
merging-values
)) ¶merging-values
)) ¶Recursively turn the input into a list of migrations to be performed
type-coercion-error
)) ¶type-coercion-error
)) ¶type-coercion-error
)) ¶type-coercion-error
)) ¶val
.
recency-mixin
) &key history-info %retrieved-at) ¶merging-values
)) ¶merging-values
)) ¶db-object
) &optional database) ¶Always prefer the passed in database or the dynamic database eg: never use the view-database slot on the object because that causes thread safety issues
clsql-sys
.
dirty-db-slots-mixin
) slotdefs vals) ¶This setfs slot values from the database values during select, so it makes sense to reset after ward
clsql-sys
.
dirty-db-slots-mixin
) slot value) ¶disable dirty slot recording if the value is from the database
clsql-sys
.
dirty-db-slots-mixin
) &key to-database-p) ¶clsql-sys
.
condition
.
condition
.
:migration-done-p
This slot is read-only.
Jump to: | %
(
A B C D E F G H I J L M N O P R S T U V W |
---|
Jump to: | %
(
A B C D E F G H I J L M N O P R S T U V W |
---|
Jump to: | %
*
+
A C D F H I M N O P S T V |
---|
Jump to: | %
*
+
A C D F H I M N O P S T V |
---|
Jump to: | C D F I M P R S T U |
---|
Jump to: | C D F I M P R S T U |
---|