XSDSQL
view release on metacpan or search on metacpan
bin/xml_repo.pl view on Meta::CPAN
#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0; # not running under some shell
use strict; # use strict is for PBP
use Filter::Include;
include blx::xsdsql::include;
#line 8
use Getopt::Std;
use File::Basename;
use DBI;
use XML::Parser;
use XML::Writer;
use blx::xsdsql::ut::ut qw(nvl ev);
use blx::xsdsql::xsd_parser;
use blx::xsdsql::schema_repository;
use blx::xsdsql::connection;
use blx::xsdsql::xml;
my %Opt=();
use constant {
COMMON_HELP1 =>
q(
-d - set the debug mode
-c <connstr> - connect string to database - the default is the value of the env var DB_CONNECT_STRING
otherwise is an error
the form is [<output_namespace>::]<dbtype>:<user>/<password>@<dbname>[:hostname[:port]][;<attribute>[,<attribute>...]
<output_namespace>::<dbtype> - see the output of namespaces command
the default for <output_namespace> is 'sql'
<dbname> - database name
<hostname> - remote host name or ip address
<port> - remote host port
<attribute> - extra attribute
Examples:
sql::pg:user/pwd@mydb:127.0.0.1;RaiseError => 1,AutoCommit => 0,pg_enable_utf8 => 1
sql::mysql:user/pwd@mydb:127.0.0.1;RaiseError => 1,AutoCommit => 0,mysql_enable_utf8 => 1
sql::oracle:user/pwd@orcl:neutrino:1522;RaiseError => 1,AutoCommit => 0
sql::DBM:dbm_mldbm=Storable;RaiseError => 1,f_dir=> q(/tmp)
-t <c|r> - issue a commit or rollback at the end (default commit)
-i ignore errors (return 0 if exists errors)
)
,COMMON_OPTIONS1 => 'hdc:t:i'
, HELP_ORDER => [qw(
instruction
namespaces
catalog_names
xml_names
drop_repository
create_repository
drop_catalog
create_catalog
drop_catalog_views
create_catalog_views
store_xml
put_xml
exec
)]
};
my %Help=(
instruction => {
options => ''
,s =>
q[
instruction
execute perl instruction
]
}
,namespaces => {
options => ''
,s =>
q[
namespaces
display on stdout the namespaces (type+db) implemented (Ex: sql::pg)
]
}
,catalog_names => {
options => ''
,s =>
q(
catalog_names <options>
display on stdout the schema catalogs stored into repository
<options>
%opt
)
}
,xml_names => {
options => ''
,s =>
q(
xml_names <options> [<catalog_name>..]
display on stdout the xml names stored into repository
<options>
( run in 1.066 second using v1.01-cache-2.11-cpan-9581c071862 )