The DatabaseEventWriter object is an EventOutput which stores Event objects in a database whenever triggered. All inserted Events can later be queried using a DatabaseQuery object and assigning the eventTable property to DatabaseQuery.table.

› Inherits:EventOutput



This property holds the Database in which the Event objects are stored. If left blank a LocalDatabase is created.

› Type:Database
› Signal:databaseChanged()
› Attributes:Writable, Optional


This property holds the most recently occurred error or DatabaseEventWriter.NoError if no error occurred. If the same error occurs multiple times this property does not change. Use the errorOccurred() signal to detect multiple occurrences of the same error.

› Type:Error
› Signal:errorChanged()
› Attributes:Readonly


This property holds the current human readable error string corresponding to the current value in the error property. It may include additional information such as failure reasons or locations.

› Type:String
› Signal:errorStringChanged()
› Attributes:Readonly


This property holds the DatabaseEventTable object which handles the mapping from Event properties to database table columns. During initialization it is attached to the database held by the database property.

› Type:DatabaseEventTable
› Signal:eventTableChanged()
› Attributes:Readonly



This signal is emitted whenever an error has occurred, regardless of whether the error property has changed or not. In contrast to the change notification signal of the error property this signal is also emitted several times if a certain error occurs several times in succession.



This enumeration describes all errors which can occur in DatabaseEventWriter objects. The most recently occurred error is stored in the error property.

Name Value Description
DatabaseEventWriter.NoError 0 No error occurred or was detected.
DatabaseEventWriter.InvalidDatabase 1 Invalid or no database set.
DatabaseEventWriter.InvalidIdError 2 Empty or invalid object ID (only alphanumeric characters allowed).


import InCore.Foundation 2.5
import InCore.Database 2.5

Application {

    EventLog {
        outputs: [
            DatabaseEventWriter {
                id: eventWriter

                //property database left blank to create a LocalDatabase
            } ]

        EventCategory { id: measurementValueCategory }
        EventGroup {
            Event {
                id: temperatureEvent
                description: "temperature above 70°C"
            Event {
                id: deviceStartedEvent
                description: "device started"
            Event {
                id: measurementValueEvent
                description: "measurement above threshold"
                category: measurementValueCategory
                severity: Event.Error

    onCompleted: deviceStartedEvent.trigger()

    //trigger events here