# Functions
BootStrap freezes model, fields and method caches and syncs the database structure with the declared data.
BootStrapped returns true if the models have been bootstrapped.
ConvertLimitToInt converts the given limit as interface{} to an int.
CreateFieldFromStruct creates a generic Field with the data from the given fStruct
fStruct must be a pointer to a struct and goType a pointer to a type instance.
CreateM2MRelModelInfo creates a Model relModelName (if it does not exist) for the m2m relation defined between model1 and model2.
CreateModel creates a new Model with the given name and options.
CreateSequence creates a new Sequence in the database and returns a pointer to it.
DBClose is a wrapper around sqlx.Close It closes the connection to the database.
DBConnect connects to a database using the given driver and arguments.
DBParams returns the DB connection parameters currently in use.
DefaultValue returns a function that is suitable for the Default parameter of model fields and that simply returns value.
ExecuteInNewEnvironment executes the given fnct in a new Environment within a new transaction.
FreeTransientModels remove transient models records from database which are older than the given timeout.
InvalidRecordCollection returns an invalid RecordCollection without an environment.
LoadCSVDataFile loads the data of the given file into the database.
NewFieldName returns a fieldName instance with the given name and json.
NewManualModel creates a model whose table is not automatically generated in the database.
NewMixinModel creates a new mixin model with the given name.
NewModel creates a new model with the given name.
NewModelData returns a pointer to a new instance of ModelData for the given model.
NewModelDataFromRS creates a pointer to a new instance of ModelData.
NewTransientModel creates a new mixin model with the given name.
NewWorkerFunction returns a WorkerFunction from the given fnct and period.
RegisterModelDataWrapper registers the object passed as obj as the ModelData type for the given model.
RegisterRecordSetWrapper registers the object passed as obj as the RecordSet type for the given model.
RegisterWorker registers a WorkerFunction so that it will be called by the core loop.
RunWorkerLoop launches the hexya core worker loop.
SimulateInNewEnvironment executes the given fnct in a new Environment within a new transaction and rolls back the transaction at the end.
SnakeCaseFieldName returns a snake cased field name, adding '_id' on x2one relation fields and '_ids' to x2many relation fields.
StopWorkerLoop stops the hexya core worker loop.
SyncDatabase creates or updates database tables with the data in the model registry.
# Constants
Cascade deletes all referencing records.
Expression separation symbols.
ContextsModel is a model for holding fields values that depend on contexts.
DBSerializationMaxRetries defines the number of time a transaction that failed due to serialization error should be retried.
Expression separation symbols.
ManualModel is a model whose table is not automatically generated in the database.
Many2ManyLinkModel is a model that abstracts the link table of a many2many relationship.
MixinModel means that this model will not be accessible like a regular model but is meant to be mixed in other models.
Restrict throws an error if there are record referencing the deleted one.
SetNull sets the foreign key to null in referencing records.
SystemModel is a model that is used internally by the Hexya Framework.
TransientModel means that the records of this model will be automatically removed periodically.
# Structs
A ColumnData holds information from the db schema about one column.
A Condition represents a WHERE clause of an SQL query.
A ConditionField is a partial Condition when we have set a field name in a predicate and are about to add an operator.
A ConditionStart is an object representing a Condition when we just added a logical operator (AND, OR, ...) and we are about to add a predicate.
ConnectionParams are the database agnostic parameters to connect to the database.
Cursor is a wrapper around a database transaction.
DummyField is used internally to inflate mixins.
An Environment stores various contextual data used by the models: - the database cursor (current open transaction), - the current user ID (for access rights checking) - the current context (for storing arbitrary metadata).
Field holds the meta information about a field.
FieldInfo is the exportable field information struct.
FieldsCollection is a collection of Field instances in a model.
FieldsGetArgs is the args struct for the FieldsGet method.
A GroupAggregateRow holds a row of results of a query with a group by clause - Values holds the values of the actual query - Count is the number of lines aggregated into this one - Condition can be used to query the aggregated rows separately if needed.
A Method is a definition of a model's method.
A MethodsCollection is a collection of methods for use in a model.
A Model is the definition of a business object (e.g.
A ModelData is used to hold values of an object instance for creating or updating a RecordSet.
OnchangeParams is the args struct of the Onchange function.
OnchangeResult is the result struct type of the Onchange function.
A Query defines the common part an SQL Query, i.e.
RecordCollection is a generic struct representing several records of a model.
A RecordRef uniquely identifies a Record by giving its model and ID.
A RecordRule allow to grant a group some permissions on a selection of records.
A Sequence holds the metadata of a DB sequence
There are two types of sequences: those created before bootstrap and those created after.
# Interfaces
A Conditioner can return a Condition object through its Underlying() method.
A FieldDefinition is a struct that declares a new field in a fields collection;.
A FieldMapper is an object that can convert itself into a FieldMap.
A FieldName is a type that can represents a field in a model.
A Methoder can return a Method data object through its Underlying() method.
A Modeler can return a Model data object through its Underlying() method.
A RecordData can return a ModelData object through its Underlying() method.
RecordSet identifies a type that holds a set of records of a given model.
A WorkerFunction can be executed in a loop in background every given LoopPeriod.
# Type aliases
A ClientEvaluatedString is a string that contains code that will be evaluated by the client.
FieldContexts define the different contexts for a field, that will define different values for this field.
FieldMap is a map of interface{} specifically used for holding model fields values.
FieldNames is a slice of FieldName that can be sorted.
An OnDeleteAction defines what to be done with this record when the target record is deleted.
Option describes a optional feature of a model.
An SQLParams is a list of parameters that are passed to the DB server with the query string and that will be used in the placeholders.