#!/usr/bin/env perlThe list of tables are:
# regc.pl - Reverse Engineer GnuCash
use strict;
use warnings;
use 5.10.0;
use DBI;
use Data::Dumper;
# Global Variables
my $gc_file = 'empty.gnucash';
my $dbh = DBI->connect("dbi:SQLite:dbname=$gc_file","","");
say Dumper tables($gc_file);
sub tables {
my $file = shift;
my $tables = [];
my $res = `echo .schema | sqlite3 $file`;
foreach my $t (split /;/, $res) {
next unless $t =~ /CREATE TABLE (.*) \(/;
push @{$tables}, $1;
}
return $tables;
}
'gnclock',
'versions',
'accounts',
'books',
'budgets',
'budget_amounts',
'commodities',
'lots',
'prices',
'schedxactions',
'transactions',
'splits',
'billterms',
'customers',
'employees',
'entries',
'invoices',
'jobs',
'orders',
'taxtables',
'taxtable_entries',
'vendors',
'recurrences',
'slots'
No comments:
Post a Comment