The weblocks-stores Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The weblocks-stores Reference Manual

This is the weblocks-stores Reference Manual, version 0.5.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:45:19 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

1.1 weblocks-stores

Maintainer

Olexiy Zamkoviy, Scott L. Burson

Author

Olexiy Zamkoviy

License

LLGPL

Description

A base for weblocks stores

Version

0.5.1

Dependencies
Source

weblocks-stores.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

2 Modules

Modules are listed depth-first from the system components tree.


Next: , Previous: , Up: Modules   [Contents][Index]

2.1 weblocks-stores/src

Parent

weblocks-stores (system)

Location

src/

Components

Previous: , Up: Modules   [Contents][Index]

2.2 weblocks-stores/src/store

Dependency

package.lisp (file)

Parent

src (module)

Location

src/store/

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 weblocks-stores.asd

Location

weblocks-stores.asd

Systems

weblocks-stores (system)

Packages

weblocks-stores-asd


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 weblocks-stores/src/package.lisp

Parent

src (module)

Location

src/package.lisp

Packages

weblocks-stores


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 weblocks-stores/src/store/store-api.lisp

Parent

store (module)

Location

src/store/store-api.lisp

Exported Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.4 weblocks-stores/src/store/store-utils.lisp

Parent

store (module)

Location

src/store/store-utils.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 weblocks-stores-asd

Source

weblocks-stores.asd

Use List

Previous: , Up: Packages   [Contents][Index]

4.2 weblocks-stores

Base for weblocks store drivers

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *debug-stores*

Debugging flag, set ’T’ to see record ids in repl, set ’NIL’ to have usual objects behavior.

Package

weblocks-stores

Source

store-api.lisp (file)

Special Variable: *default-serialization-format*

Debugging flag, set ’T’ to see record ids in repl, set ’NIL’ to have usual objects behavior.

Package

weblocks-stores

Source

store-api.lisp (file)

Special Variable: *default-store*

The default store to which objects are persisted. Bound while a webapp is handling a request to the value of its ‘webapp-default-store-name’. By using ‘defstore’ after the relevant ‘defwebapp’ in the same package, barring an explicit setting, the webapp will be set to use the defined store automatically.

Package

weblocks-stores

Source

store-api.lisp (file)

Special Variable: *store-names*

A list of store names in the order in which they were defined.

Package

weblocks-stores

Source

store-utils.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Macros

Macro: defstore NAME TYPE &rest STORE-ARGS

A macro that helps define a store. A global variable ’name’ is defined, and ’open-store’ is called with appropriate store type and arguments. Note that the last store will also be the default (see *default-store*). All stores defined via ’defstore’ will be opened and bound when ’start-weblocks’ is called, and closed when ’stop-weblocks’ is called. If ‘store-args’ contains a keyword ’load-store-system-p’ with a value of NIL following it then the store’s ASDF system (‘weblocks-STORENAME’) will not be loaded afterwards. Turning this off is useful for binary images.

Package

weblocks-stores

Source

store-utils.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Functions

Function: class-visible-slots CLS &key READABLEP WRITABLEP

Converts ’cls’ to class object if it is a name, and calls ’class-visible-slots-impl’.

Package

weblocks-stores

Source

store-api.lisp (file)

Function: close-stores ()

Closes all stores.

Package

weblocks-stores

Source

store-utils.lisp (file)

Function: list-store-types ()
Package

weblocks-stores

Source

store-utils.lisp (file)

Function: mapstores FN

Maps a function over existing stores in the order in which they were defined. Returns NIL.

Package

weblocks-stores

Source

store-utils.lisp (file)

Function: object-id-slot-name OBJ

Returns the slot name of the slot that holds the unique identifier of ’obj’. This information is obtained via calling ’class-id-slot-name’.

Package

weblocks-stores

Source

store-utils.lisp (file)

Function: object-store OBJ

Returns the store for the object by calling ’class-store’.

Package

weblocks-stores

Source

store-utils.lisp (file)

Function: open-stores ()

Opens and binds all stores.

Package

weblocks-stores

Source

store-utils.lisp (file)

Function: persist-objects STORE OBJECTS &rest KEYS

Persists all objects in ’objects’ sequence into ’store’.

Package

weblocks-stores

Source

store-utils.lisp (file)

Function: register-store-type STORE-TYPE
Package

weblocks-stores

Source

store-utils.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Generic functions

Generic Function: begin-transaction STORE

Begins a transaction on ’store’. Note, if the given
store does not have transaction support, this function should return NIL without signalling errors.

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: class-id-slot-name CLASS

Must return the symbol that identifies the slot name which represents the unique ID of the class named ’class’. Default implementation returns ’ID’. Specialize this function if you want to name the slot that holds the class’ unique ID differently.

Package

weblocks-stores

Source

store-utils.lisp (file)

Methods
Method: class-id-slot-name CLASS
Generic Function: class-store CLASS-NAME

Returns the store where objects of class name
should be persisted. This function should be used by widgets to persist objects. Default implementation returns *default-store*.

Package

weblocks-stores

Source

store-utils.lisp (file)

Methods
Method: class-store CLASS-NAME
Generic Function: class-visible-slots-impl CLS &key READABLEP WRITABLEP

Returns a list of ’standard-direct-slot-definition’
objects for a class and its subclasses. Slots objects for slots that do not have reader accessors are filtered out and not returned.

If ’readablep’ is true, filters out the slots that don’t have a reader (or accessor) defined.
If ’writablep’ is true, filters out the slots that don’t have a writer (or accessor) defined.

Package

weblocks-stores

Source

store-api.lisp (file)

Methods
Method: class-visible-slots-impl CLS &key READABLEP WRITABLEP
Generic Function: clean-store STORE

Cleans all the data in the store. This function
should erase data, but not necessarily any schema information (like tables, etc.)

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: close-store STORE

Closes a connection to the store. If the value of
*default-store* is equal to ’store’, *default-store* must be set to NIL.

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: commit-transaction STORE

Commits a transaction started on ’store’. Note, if
the given store does not have transaction support, or the store isn’t in a transaction, this function should return NIL without signalling errors.

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: count-persistent-objects STORE CLASS-NAME &key &allow-other-keys

Returns the number of persistent objects stored in
’store’ of ’class-name’, bound by the given keyword parameters. For documentation of keyword parameters, see ’find-persistent-objects’.

Other implementation dependent keys may be defined by a given store.

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: delete-model-class STORE CLS

Completely removes model class. ‘list-model-classes‘ should not contain class after calling this method.

Package

weblocks-stores

Source

store-api.lisp (file)

Methods
Method: delete-model-class STORE CLS
Generic Function: delete-persistent-object STORE OBJECT

Deletes the persistent object from ’store’. After
deleting the persistent object, set unique ID of ’object’ to NIL (see ’(setf object-id)’).

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: delete-persistent-object-by-id STORE CLASS-NAME OBJECT-ID

Similar to ’delete-persistent-object’, but instead deletes object with the specified ’object-id’.

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: dynamic-transaction STORE PROC

Call PROC, a thunk, while in a transaction of STORE. See ‘use-dynamic-transaction-p’ for details.

Package

weblocks-stores

Source

store-api.lisp (file)

Methods
Method: dynamic-transaction STORE PROC
Generic Function: find-persistent-object-by-id STORE CLASS-NAME OBJECT-ID

Finds and returns a persistent object of a given
class name in a given store by its unique id. If the object isn’t found, returns NIL.

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: find-persistent-objects STORE CLASS-NAME &key ORDER-BY RANGE &allow-other-keys

Looks up and returns objects of appropriate
’class-name’ in the ’store’ bound by the given keyword parameters.

If ’order-by’ is specified, orders the returned objects by the given slot in the given order. If ’order-by’ is not NIL, it is expected to be a cons cell with slot name as ’car’ and :asc or :desc as ’cdr’.

If ’range’ is specified, returns only the specified range of objects. The CAR of ’range’ is the index of the initial
object (inclusive) and CDR is the index past the last object. Note, the range should be applied after the objects have been filtered and ordered if necessary.

Other implementation dependent keys may be defined by a given store.

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: list-model-classes STORE

Returns list with symbols - models class names

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: object-id OBJ

Returns a value that uniquely identifies an object in memory or in a backend store. The default implementation looks for an ’id’ slot via ’slot-value’. If such slot is not present, signals an
error. Specialize this function for various back end stores and other object identification schemes.

Package

weblocks-stores

Source

store-utils.lisp (file)

Writer

(setf object-id) (generic function)

Methods
Method: object-id (OBJ null)
Method: object-id (OBJ standard-object)
Generic Function: (setf object-id) ID OBJ

Sets the value that uniquely identifies an object in memory or in a backend store. The default implementation tries to set an ’id’ slot via ’slot-value’. If such slot is not present, signals an
error. Specialize this function for various back end stores and other object identification schemes.

Package

weblocks-stores

Source

store-utils.lisp (file)

Reader

object-id (generic function)

Methods
Method: (setf object-id) ID (OBJ standard-object)
Generic Function: open-store STORE-TYPE &rest ARGS

Opens a connection to a store specified by
’store-type’. This function must return the instance of the connection to the store. Methods can accept any number of custom keyword parameters. Additionally, the function must set *default-store* to the value of newly created store.

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: persist-object STORE OBJECT &key

Persists ’object’ into ’store’, answering
’object’. If the object does not have a unique ID (see ’object-id’), persist ’object’ into store and set its unique ID via (see ’(setf object-id)’). If the object has a unique ID, find relevant entry in the store and update it with ’object’.

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: replace-on-redefine-p STORE-TYPE

When true replaces existing store on reexecuting (defstore ...) block.

Package

weblocks-stores

Source

store-api.lisp (file)

Methods
Method: replace-on-redefine-p STORE-TYPE
Generic Function: rollback-transaction STORE

Rolls back a transaction started on ’store’. Note,
if the given store does not have transaction support, or the store isn’t in a transaction, this function should return NIL without signalling errors.

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: serialize OBJ &key FORMAT

Method for serialization of objects, objects sets for specific model and stores.

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: store-type STORE

Should return keyword type of store

Package

weblocks-stores

Source

store-api.lisp (file)

Methods
Method: store-type (STORE null)
Method: store-type STORE
Generic Function: unserialize OBJ &key FORMAT

Method for deserialization of objects, objects sets for specific model and stores.

Package

weblocks-stores

Source

store-api.lisp (file)

Generic Function: use-dynamic-transaction-p STORE

Answer whether ‘action-txn-hook’ and equivalents
should use GF ‘dynamic-transaction’ for transaction control rather than the ‘begin-transaction’, ‘commit-transaction’, and ‘rollback-transaction’ GFs. Be warned that non-local exit behavior for stores that answer true for this may have unique non-local exit unwind behavior.

Package

weblocks-stores

Source

store-api.lisp (file)

Methods
Method: use-dynamic-transaction-p STORE

Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *store-types*
Package

weblocks-stores

Source

store-utils.lisp (file)

Special Variable: *stores*

A hashmap of stores, where each item has store name as key, and structure of type ’store-info’ as value.

Package

weblocks-stores

Source

store-utils.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: %defstore-postdefine NAME TYPE

Helper for ‘defstore’.

Package

weblocks-stores

Source

store-utils.lisp (file)

Function: %defstore-predefine NAME TYPE &rest ARGS

Helper for ‘defstore’.

Package

weblocks-stores

Source

store-utils.lisp (file)

Function: copy-store-info INSTANCE
Package

weblocks-stores

Source

store-utils.lisp (file)

Function: make-store-info &key (TYPE TYPE) (ARGS ARGS)
Package

weblocks-stores

Source

store-utils.lisp (file)

Function: maybe-replace-store NAME

Replaces store on (defstore ...) call repeating.
Works only for those stores for which (replace-on-redefine-p ...) is true

Package

weblocks-stores

Source

store-utils.lisp (file)

Function: store-info-args INSTANCE
Function: (setf store-info-args) VALUE INSTANCE
Package

weblocks-stores

Source

store-utils.lisp (file)

Function: store-info-p OBJECT
Package

weblocks-stores

Source

store-utils.lisp (file)

Function: store-info-type INSTANCE
Function: (setf store-info-type) VALUE INSTANCE
Package

weblocks-stores

Source

store-utils.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Structures

Structure: store-info ()

Information about a store.

Package

weblocks-stores

Source

store-utils.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: type
Type

symbol

Readers

store-info-type (function)

Writers

(setf store-info-type) (function)

Slot: args
Readers

store-info-args (function)

Writers

(setf store-info-args) (function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   M   W  
Index Entry  Section

F
File, Lisp, weblocks-stores.asd: The weblocks-stores<dot>asd file
File, Lisp, weblocks-stores/src/package.lisp: The weblocks-stores/src/package<dot>lisp file
File, Lisp, weblocks-stores/src/store/store-api.lisp: The weblocks-stores/src/store/store-api<dot>lisp file
File, Lisp, weblocks-stores/src/store/store-utils.lisp: The weblocks-stores/src/store/store-utils<dot>lisp file

L
Lisp File, weblocks-stores.asd: The weblocks-stores<dot>asd file
Lisp File, weblocks-stores/src/package.lisp: The weblocks-stores/src/package<dot>lisp file
Lisp File, weblocks-stores/src/store/store-api.lisp: The weblocks-stores/src/store/store-api<dot>lisp file
Lisp File, weblocks-stores/src/store/store-utils.lisp: The weblocks-stores/src/store/store-utils<dot>lisp file

M
Module, weblocks-stores/src: The weblocks-stores/src module
Module, weblocks-stores/src/store: The weblocks-stores/src/store module

W
weblocks-stores.asd: The weblocks-stores<dot>asd file
weblocks-stores/src: The weblocks-stores/src module
weblocks-stores/src/package.lisp: The weblocks-stores/src/package<dot>lisp file
weblocks-stores/src/store: The weblocks-stores/src/store module
weblocks-stores/src/store/store-api.lisp: The weblocks-stores/src/store/store-api<dot>lisp file
weblocks-stores/src/store/store-utils.lisp: The weblocks-stores/src/store/store-utils<dot>lisp file

Jump to:   F   L   M   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   %   (  
B   C   D   F   G   L   M   O   P   R   S   U  
Index Entry  Section

%
%defstore-postdefine: Internal functions
%defstore-predefine: Internal functions

(
(setf object-id): Exported generic functions
(setf object-id): Exported generic functions
(setf store-info-args): Internal functions
(setf store-info-type): Internal functions

B
begin-transaction: Exported generic functions

C
class-id-slot-name: Exported generic functions
class-id-slot-name: Exported generic functions
class-store: Exported generic functions
class-store: Exported generic functions
class-visible-slots: Exported functions
class-visible-slots-impl: Exported generic functions
class-visible-slots-impl: Exported generic functions
clean-store: Exported generic functions
close-store: Exported generic functions
close-stores: Exported functions
commit-transaction: Exported generic functions
copy-store-info: Internal functions
count-persistent-objects: Exported generic functions

D
defstore: Exported macros
delete-model-class: Exported generic functions
delete-model-class: Exported generic functions
delete-persistent-object: Exported generic functions
delete-persistent-object-by-id: Exported generic functions
dynamic-transaction: Exported generic functions
dynamic-transaction: Exported generic functions

F
find-persistent-object-by-id: Exported generic functions
find-persistent-objects: Exported generic functions
Function, %defstore-postdefine: Internal functions
Function, %defstore-predefine: Internal functions
Function, (setf store-info-args): Internal functions
Function, (setf store-info-type): Internal functions
Function, class-visible-slots: Exported functions
Function, close-stores: Exported functions
Function, copy-store-info: Internal functions
Function, list-store-types: Exported functions
Function, make-store-info: Internal functions
Function, mapstores: Exported functions
Function, maybe-replace-store: Internal functions
Function, object-id-slot-name: Exported functions
Function, object-store: Exported functions
Function, open-stores: Exported functions
Function, persist-objects: Exported functions
Function, register-store-type: Exported functions
Function, store-info-args: Internal functions
Function, store-info-p: Internal functions
Function, store-info-type: Internal functions

G
Generic Function, (setf object-id): Exported generic functions
Generic Function, begin-transaction: Exported generic functions
Generic Function, class-id-slot-name: Exported generic functions
Generic Function, class-store: Exported generic functions
Generic Function, class-visible-slots-impl: Exported generic functions
Generic Function, clean-store: Exported generic functions
Generic Function, close-store: Exported generic functions
Generic Function, commit-transaction: Exported generic functions
Generic Function, count-persistent-objects: Exported generic functions
Generic Function, delete-model-class: Exported generic functions
Generic Function, delete-persistent-object: Exported generic functions
Generic Function, delete-persistent-object-by-id: Exported generic functions
Generic Function, dynamic-transaction: Exported generic functions
Generic Function, find-persistent-object-by-id: Exported generic functions
Generic Function, find-persistent-objects: Exported generic functions
Generic Function, list-model-classes: Exported generic functions
Generic Function, object-id: Exported generic functions
Generic Function, open-store: Exported generic functions
Generic Function, persist-object: Exported generic functions
Generic Function, replace-on-redefine-p: Exported generic functions
Generic Function, rollback-transaction: Exported generic functions
Generic Function, serialize: Exported generic functions
Generic Function, store-type: Exported generic functions
Generic Function, unserialize: Exported generic functions
Generic Function, use-dynamic-transaction-p: Exported generic functions

L
list-model-classes: Exported generic functions
list-store-types: Exported functions

M
Macro, defstore: Exported macros
make-store-info: Internal functions
mapstores: Exported functions
maybe-replace-store: Internal functions
Method, (setf object-id): Exported generic functions
Method, class-id-slot-name: Exported generic functions
Method, class-store: Exported generic functions
Method, class-visible-slots-impl: Exported generic functions
Method, delete-model-class: Exported generic functions
Method, dynamic-transaction: Exported generic functions
Method, object-id: Exported generic functions
Method, object-id: Exported generic functions
Method, replace-on-redefine-p: Exported generic functions
Method, store-type: Exported generic functions
Method, store-type: Exported generic functions
Method, use-dynamic-transaction-p: Exported generic functions

O
object-id: Exported generic functions
object-id: Exported generic functions
object-id: Exported generic functions
object-id-slot-name: Exported functions
object-store: Exported functions
open-store: Exported generic functions
open-stores: Exported functions

P
persist-object: Exported generic functions
persist-objects: Exported functions

R
register-store-type: Exported functions
replace-on-redefine-p: Exported generic functions
replace-on-redefine-p: Exported generic functions
rollback-transaction: Exported generic functions

S
serialize: Exported generic functions
store-info-args: Internal functions
store-info-p: Internal functions
store-info-type: Internal functions
store-type: Exported generic functions
store-type: Exported generic functions
store-type: Exported generic functions

U
unserialize: Exported generic functions
use-dynamic-transaction-p: Exported generic functions
use-dynamic-transaction-p: Exported generic functions

Jump to:   %   (  
B   C   D   F   G   L   M   O   P   R   S   U  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
A   S   T  
Index Entry  Section

*
*debug-stores*: Exported special variables
*default-serialization-format*: Exported special variables
*default-store*: Exported special variables
*store-names*: Exported special variables
*store-types*: Internal special variables
*stores*: Internal special variables

A
args: Internal structures

S
Slot, args: Internal structures
Slot, type: Internal structures
Special Variable, *debug-stores*: Exported special variables
Special Variable, *default-serialization-format*: Exported special variables
Special Variable, *default-store*: Exported special variables
Special Variable, *store-names*: Exported special variables
Special Variable, *store-types*: Internal special variables
Special Variable, *stores*: Internal special variables

T
type: Internal structures

Jump to:   *  
A   S   T  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   S   W  
Index Entry  Section

P
Package, weblocks-stores: The weblocks-stores package
Package, weblocks-stores-asd: The weblocks-stores-asd package

S
store-info: Internal structures
Structure, store-info: Internal structures
System, weblocks-stores: The weblocks-stores system

W
weblocks-stores: The weblocks-stores system
weblocks-stores: The weblocks-stores package
weblocks-stores-asd: The weblocks-stores-asd package

Jump to:   P   S   W