Database

We support Postgres database.

Multiple hosts

The dsn parameter of service database config should be specified to enable multihost option for Postgres.

DSN may be specified in the following format: luna:luna@postgres01:5432,postgres02:5432/luna_events?some_option=some_value. It is possible to partially fill in the DSN string (e.g. postgres01,postgres02/luna_events), and then the missing parameters will be filled in from proprietary parameter values (or defaults).

At startup, the service will create a pool of connections to one of DSN hosts available. In case of problems with establishing a connection after several unsuccessful attempts, the service will again try to set up a connection pool to any of DSN hosts available.

DB scheme

_images/luna_events.png
class luna_events.db.events_db_tools.models.events_models.AttachResult(**kwargs)

Attach result ORM class

class luna_events.db.events_db_tools.models.events_models.BodyDescriptor(**kwargs)

Descriptor ORM class.

class luna_events.db.events_db_tools.models.events_models.BodyDetectResult(**kwargs)

Body detection results.

class luna_events.db.events_db_tools.models.events_models.DeletedEvent(**kwargs)
class luna_events.db.events_db_tools.models.events_models.DeletedGeneralEvent(**kwargs)
class luna_events.db.events_db_tools.models.events_models.Descriptor(**kwargs)

Descriptor ORM class.

class luna_events.db.events_db_tools.models.events_models.Event(**kwargs)

Event ORM class.

class luna_events.db.events_db_tools.models.events_models.EventMatchResult(**kwargs)

Match result ORM class.

class luna_events.db.events_db_tools.models.events_models.EventStatsColumn(*args, targetable=False, filterable=False, **kwargs)

Column which used for stat requests.

targetable

column is target able

filterable

column is filter able

inherit_cache = True

Indicate if this HasCacheKey instance should make use of the cache key generation scheme used by its immediate superclass.

The attribute defaults to None, which indicates that a construct has not yet taken into account whether or not its appropriate for it to participate in caching; this is functionally equivalent to setting the value to False, except that a warning is also emitted.

This flag can be set to True on a particular class, if the SQL that corresponds to the object does not change based on attributes which are local to this class, and not its superclass.

See also

compilerext_caching - General guideslines for setting the HasCacheKey.inherit_cache attribute for third-party or user defined SQL constructs.

class luna_events.db.events_db_tools.models.events_models.FaceDetectResult(**kwargs)

Detect result ORM class.

class luna_events.db.events_db_tools.models.events_models.FaceMatchResult(**kwargs)

Match result ORM class.

class luna_events.db.events_db_tools.models.events_models.GeneralDescriptor(**kwargs)

General descriptor ORM class.

class luna_events.db.events_db_tools.models.events_models.GeneralEvent(**kwargs)

General event ORM class.

class luna_events.db.events_db_tools.models.events_models.Location(**kwargs)
class luna_events.db.events_db_tools.models.events_models.Migrations(**kwargs)

Migrations ORM class.

class luna_events.db.events_db_tools.models.events_models.Tag(**kwargs)

Tag ORM class