The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

FTNDB To Do

General

Although the NAME entry is present, getting the following warning: $ perl Makefile.PL WARNING: Setting ABSTRACT via file 'lib/FTNDB.pm' failed

Move code repository information and the distribution archive information from the README file to elsewhere. POD in main module? website and/or wiki?

Add an option, like -r, for specifying a region number; to be used like the zone (-z) or net (-n) options, and available all commands as needed.

The option used to define which type of database to use does not currently do any error checking on that type; the script will fail if a correct DBD name is not used. Get & use a list of the currently installed DBI DBD modules? If do not explicitly do such error or other checking, document the standard names for DBI DBD modules like SQlite (default), mysql, cvs, and postgresql.

The use of special characters like periods in table names is a more general issue where it is not a good idea to use them at all. Redo the comments in scripts and modules regarding that, to generalize it. (Derive function to validate it and add th at to the FTN::Database module?)

Create FTNDB::Examples for example configuration files and scripts.

Once the non database table related code in FTN::Database::Nodelist and FTN::Database::Nodelist is properly separated out, make ftn-database and ftndb into being separate distributions, creating a new branch 'ftn-database' in the git respository to track FTN::Database.

ftndbadm

Develop a new version of the ftndb-admin script, basing it on App::Cmd and at least initially having the name ftndbadm.

FTNDB::Command::create.pm

As part of the transistion to using App::Cmd; move the functionality for the create command from bin/ftndb-admin and lib/FTNDB/Admin.pm to the new module for the create command.

FTNDB::Command::drop.pm

As part of the transistion to using App::Cmd; move the functionality for the drop command from bin/ftndb-admin and lib/FTNDB/Admin.pm to the new module for the drop command.

FTNDB::Admin

Rename and move FTN::Database to FTNDB::Admin, retaining the FTN::Database namespace for things like defining the FTN database tables.

The create_ftn_database function as currently coded really only works for sqlite databases, because it uses an already open db handle and to get that in for instance postgresql you need to define a database for the login.

Derive a generic create_ftn_table subroutine from the create_nodelist_table function in FTN::Database::Nodelist, using a variable in the sql for the table definition. Then change the create_nodelist_table function to use it.

Create set_ftndb_acl subroutine? (Same reasoning as for create_ftn_database.)

Possible function/subroutine that checks if a valid database table name is being used? And corrects it if possible?

FTNDB::Nodelist

Move the code in FTN::Database::Nodelist to FTNDB::Nodelist. Keep the separate namespace FTN::Database::Nodelist itself, since it already exists, for just the definition of a nodelist table. Perhaps change that to be a function that returns the SQL code to define the table, instead of being code that does the creation of it (Which would work better with the generic create_ftn_table function.)

Add a function to enable reading the nodelist header; it will return a hash, with at least the ftnyear and yearday information. (Should really be a function of or an extension to FTN::Nodelist.)

Derive and move function to insert or update an entry from ftndb-nodelist. Separate functions for insert & update, or different options in same function?

Move get_nodelist_filename subroutine from the ftndb-nodelist script?

Derive and move a function for executing queries on the nodelist table from the code used in the list_ftn_nodelist subroutine.

As part of adding statistics related functions, add a function that counts the number of nodes that have a particular flag associated with it? Could use the name "get_nodelist_flag_count ($dbh, $table_name, $nodelist_flag)" but how to build in extra parts of the search for things like "zone = 1"? Also add something that counts the number of things like hubs, nodes marked as private, etc?

ftndb-nodelist

Move create_ftn_nodelist_table from ftndb-admin to ftndb-nodelist, but also leave a generic create_ftn_table subroutine there in ftndb-admin.

The 'region' field for a zone independent node is not being set correctly in the database; example 2:2/0 is being set to region 19, or 1:1/0 which is being set to 0. Should be set to the same as the zone number.

Need to add something to the database to reflect nodes being under a hub.

Move code for processing the -f & -e options into a separate subroutine, so it could be used by more than just the load command?

Two additional fields are now available in the nodelist table; one for the year of the particular nodelist being worked on and is named 'ftnyear', and one for the day number of the nodelist being worked on and is named 'yearday'. Both fields have been added to the default ftnode index. This will allows historical nodelist information in the database by being able to have more than just one of a particular type. Need to add functionality to the script and/or module to enable this, including especially being able to determine the two fields from information in the nodelist being loaded. Change load command to only load new nodelist information.

Add separate commands to create or drop the ftnnode index on the nodelist table?

Script does not seem to properly handle a file that ends in just blank lines, instead of a content line or a ^Z character. (Should fail gracefully for a badly formatted file.)

The list of nodelist files is being reverse sorted when there are multiple nodelists of the same basename being processed; that takes care of a set of files all from the same year but not ones that are from different years.

Add a test nodelist for use with this?

Use a template framework of some sort instead of the builtin 'format' operations for the reporting functionality. Add the type field to the List command output? Redo the header (extra line)?

ftndb-admin

Remove the ftndb-admin script from the distribution once its functionality has been removed and/or replaced.

Testing

    - Procedure in test script?
    1) get temp directory
    2) create working directory there
    3) ... testing ...
    4) remove test working directory
    5) done

SEE ALSO

 L<ftndbadm>, L<ftndb-admim>, L<ftndb-nodelist>, L<FTNDB>, L<FTNDB::Command::create>,
  L<FTNDB::Command::drop>, L<FTN::Database>, L<FTN::Database::Nodelist>

AUTHOR

Robert James Clay, <jame at rocasa.us>

COPYRIGHT & LICENSE

Copyright 2012 Robert James Clay, all rights reserved.

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