FastDB::Delete - Delete selected data from FastDB database


        use FastDB::Delete;
        my $obj = Delete->new(
        'Schema file'                      => $SchemaFile,
        'Allow deletion with no filters'   => yes|no     ,
        'Show activity at standard output' => yes|no     );
        $obj->delete( col1 => 'Perl code1' , col2 => 'Perl code2', ... );


        my $obj = Delete->new(
        'Schema file'                      => '/work/FastDB test/db/Export cargo.schema',
        'Allow deletion with no filters'   => 'No',
        'Show activity at standard output' => 'yes'  );
        'WEIGHT'     => '(DATA > 2000) and (DATA <= 100000) and ( DATA % 2 == 0)' ,
        'EXTRA_YEAR' => 'DATA == 2011' );


Delete selected data from FastDB databases. You can select data for deletion using Filters. Only rows that all their column Filters are true can be deleted.

You can have multiple Filters. Every Filter is assigned only to one column. The Filter's order is not important. Every Filter is simple Perl code. The last returned value of your code is examined if it is TRUE or FALSE. The special string DATA is replaced with column values.


my $obj = Delete->new( %hash );

Creates a new FastDB::Delete object. %hash must have the keys

Schema file

This is where your schema File is. The schema file is a unique file for every database, and it is created at first data load, inside data directory. Its name is "$DatabaseName.schema"

Allow deletion with no filters

Yes or No. If it is No, you are not allowed to delete data if you do not specify any Filters. If it yes and you do not define any Filters, then all your database data will be deleted.

Show activity at standard output

Yes or No. If it is yes it displays at standard output short information of its activity.

$load->delete( %Filters );

delete deletes the data. Accepts a hash with columns as keys and generic Perl code as values. Every filter evaluate only the data of its column. That means at Perl code you can not write column names . The special string DATA is replaced with current column value.


This module is written with pure perl, so it can run on all operating systems. It is designed to work as fast your disk and operating system is.


Because this module is implemented with pure Perl it is enough to copy FastDB directory somewhere at your @INC or where your script is. For your convenient you can use the following commands to install/uninstall the module

        Install: -install   --module=FastDB
        Uninstall: -uninstall --module=FastDB


Author: (George Mpouras)


Copyright (c) 2011, George Mpouras, All rights reserved.

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.