Chapter 6. Schemas Reference
Prev | Part III. Developer's Reference | Next

## Chapter 6. Schemas Reference

This chapter documents the available schemas in the standard Lire suite. For each superservice, the base schema is explained, followed by any extended and derived schemas.

## Schemas for the database Superservice

### DLF Schema for Database service

Schema ID: `database`

Timestamp Field: `time`

A record in the database DLF schema represents one event in the database. This may be a connection from a client, a SQL query, etc.

Fields in the Schema

`time`

  Type: timestamp

  Defaults: 0

  The time at which the event occured.

`user`

  Type: string

  Defaults: -

  The name of the user who executed the command.

`remote_host`

  Type: hostname

  Defaults: -

  The host from which the user executed the command.

`action`

  Type: string

  Defaults: -

  The command that was executed. Commands you are likely to encounter are `connect`, `disconnect`, `shutdown` and `query`.

`database`

  Type: string

  Defaults: -

  The database name on which the command was executed.

`query`

  Type: string

  Defaults: -

  When the `command` field is a `query`, this field contains the actual SQL query that was executed.

`success`

  Type: bool

  Defaults: -

  Did the command succeeded?

`result`

  Type: string

  Defaults: -

  When the `success` field is `false`, i.e. when the command failed, this field should contains the logged error message.

`connection_id`

  Type: int

  Defaults: -

  An "appropriate" "connection label" for the backend that can be used for session analysis in conjunction with the `timestamp`, `username` and `database` fields. This can be a connection identifier, a PID, a real session ID or whatever makes sense in the particular backend.

### Extended Schemas for the database Superservice

#### Query Type Extended Schema for Database Superservice

Schema ID: `database-querytype`

Base Schema: `database`

Module: `Lire::Extensions::Database::DatabaseSchema`

Required Fields: query

An extended schema for the database superservice which extracts the query type from the query that was made.

Fields in the Schema

`querytype`

  Type: string

  Defaults: -

  The type of SQL query that was made. This will be usually be something like `SELECT`, `INSERT`, `UPDATE`, `DELETE` or other administrative commands. In the case of nested queries, this will be the type of the outer-most query.

Prev | Up | Next
Part III. Developer's Reference | Home | Schemas for the dialup Superservice