<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE lire:dlf-schema PUBLIC
  "-//LogReport.ORG//DTD Lire DLF Schema Markup Language V1.1//EN"
  "http://www.logreport.org/LDSML/1.1/ldsml.dtd">
<lire:dlf-schema superservice="database" timestamp="time"
 xmlns:lire="http://www.logreport.org/LDSML/">

 <lire:title>DLF Schema for Database service</lire:title>

 <lire:description>
  <para>A record in the <type>database</type> DLF schema represents
   one event in the database. This may be a connection from a client,
   a SQL query, etc.
  </para>
 </lire:description>

 <lire:field name="time" type="timestamp" label="Timestamp">
  <lire:description>
   <para>The time at which the event occured.</para>
  </lire:description>
 </lire:field>

 <lire:field name="user" type="string" label="User">
  <lire:description>
   <para>The name of the user who executed the command.</para>
  </lire:description>
 </lire:field>

 <lire:field name="remote_host"	type="hostname" label="Client Host">
  <lire:description>
   <para>The host from which the user executed the command.</para>
  </lire:description>
 </lire:field>

 <lire:field name="action" type="string" label="Query Action">
  <lire:description>
   <para>The command that was executed. Commands you are likely to
    encounter are <constant>connect</constant>,
    <constant>disconnect</constant>, <constant>shutdown</constant> and
    <constant>query</constant>. 
   </para>
  </lire:description>
 </lire:field>

 <lire:field name="database" type="string" label="">
  <lire:description>
   <para>The database name on which the command was executed.</para>
  </lire:description>
 </lire:field>

 <lire:field name="query" type="string">
  <lire:description>
   <para>When the <structfield>command</structfield> field is a
    <constant>query</constant>, this field contains the actual SQL
    query that was executed.
   </para>
  </lire:description>
 </lire:field>

 <lire:field name="success" type="bool" label="Success?">
  <lire:description>
   <para>Did the command succeeded?</para>
  </lire:description>
 </lire:field>

 <lire:field name="result" type="string" label="Error">
  <lire:description>
   <para>When the <structfield>success</structfield> field is
    <constant>false</constant>, i.e. when the command failed, this
    field should contains the logged error message.</para>
  </lire:description>
 </lire:field>

 <lire:field name="connection_id" type="int" label="Connection ID">
  <lire:description>
   <para>An "appropriate" "connection label" for the backend that can
    be used for session analysis in conjunction with the
    <structfield>timestamp</structfield>,
    <structfield>username</structfield> and
    <structfield>database</structfield> fields. This can be a
    connection identifier, a PID, a real session ID or whatever makes
    sense in the particular backend.
   </para>
  </lire:description>
 </lire:field>

</lire:dlf-schema>
