Eric Waters > App-AltSQL-0.05 > App::AltSQL::Plugin::Tail

Download:
App-AltSQL-0.05.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source  

TAIL ^

Given:

 CREATE TABLE log_entries (
   id  int primary key auto_increment,
   ts  datetime not null,
   log varchar(255) not null
 );

The SQL:

 .tail ts, log from log_entries every 30;

Will:

 * Find the column 'id', which is the only primary key and is auto_increment
 * Find the current auto_increment value of id as last_seen_max_value
 * Loop:
   - sleep 30 seconds
   - select ts, log from log_entries where id > last_seen_max_value
   - update last_seen_max_value

Other recognized forms:

 .tail * from log_entries every 30;
 .tail log_entries every 30;

 .tail log from log_entries where log like '%ERROR%' every 30;
syntax highlighting: