view release on metacpan or search on metacpan
lib/DBD/PgLite/MirrorPgToSQLite.pm view on Meta::CPAN
$opt{pg_dbh}->disconnect if $disconnect;
$opt{sl_dbh}->disconnect;
if (-f $fn) {
copy $fn, "$fn.bak" or warn "WARNING: Could not make backup copy of $fn: $!\n";
}
move "$fn.tmp", $fn or die "ERROR: Could not move temporary SQLite file $fn.tmp to $fn";
lockfile('clear',$lockfile);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/SQLAnywhere/GetInfo.pm view on Meta::CPAN
and
any
as
asc
attach
backup
begin
between
bigint
binary
bit
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/SQLcipher.pm view on Meta::CPAN
DBD::SQLcipher::db->install_method('sqlite_progress_handler');
DBD::SQLcipher::db->install_method('sqlite_commit_hook');
DBD::SQLcipher::db->install_method('sqlite_rollback_hook');
DBD::SQLcipher::db->install_method('sqlite_update_hook');
DBD::SQLcipher::db->install_method('sqlite_set_authorizer');
DBD::SQLcipher::db->install_method('sqlite_backup_from_file');
DBD::SQLcipher::db->install_method('sqlite_backup_to_file');
DBD::SQLcipher::db->install_method('sqlite_enable_load_extension');
DBD::SQLcipher::db->install_method('sqlite_load_extension');
DBD::SQLcipher::db->install_method('sqlite_register_fts3_perl_tokenizer');
DBD::SQLcipher::db->install_method('sqlite_trace', { O => 0x0004 });
DBD::SQLcipher::db->install_method('sqlite_profile', { O => 0x0004 });
lib/DBD/SQLcipher.pm view on Meta::CPAN
the access attempt, or C<undef> if this access attempt is directly from
top-level SQL code.
=back
=head2 $dbh->sqlite_backup_from_file( $filename )
This method accesses the SQLcipher Online Backup API, and will take a backup of
the named database file, copying it to, and overwriting, your current database
connection. This can be particularly handy if your current connection is to the
special :memory: database, and you wish to populate it from an existing DB.
=head2 $dbh->sqlite_backup_to_file( $filename )
This method accesses the SQLcipher Online Backup API, and will take a backup of
the currently connected database, and write it out to the named file.
=head2 $dbh->sqlite_enable_load_extension( $bool )
Calling this method with a true value enables loading (external)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/SQLeet.pm view on Meta::CPAN
DBD::SQLeet::db->install_method('sqlite_progress_handler');
DBD::SQLeet::db->install_method('sqlite_commit_hook');
DBD::SQLeet::db->install_method('sqlite_rollback_hook');
DBD::SQLeet::db->install_method('sqlite_update_hook');
DBD::SQLeet::db->install_method('sqlite_set_authorizer');
DBD::SQLeet::db->install_method('sqlite_backup_from_file');
DBD::SQLeet::db->install_method('sqlite_backup_to_file');
DBD::SQLeet::db->install_method('sqlite_enable_load_extension');
DBD::SQLeet::db->install_method('sqlite_load_extension');
DBD::SQLeet::db->install_method('sqlite_register_fts3_perl_tokenizer');
DBD::SQLeet::db->install_method('sqlite_trace', { O => 0x0004 });
DBD::SQLeet::db->install_method('sqlite_profile', { O => 0x0004 });
view all matches for this distribution
view release on metacpan or search on metacpan
sqlite-amalgamation.c view on Meta::CPAN
** if the pointer can possibly be shared with
** another database connection.
**
** The pointers are kept in sorted order by pBtree->pBt. That
** way when we go to enter all the mutexes, we can enter them
** in order without every having to backup and retry and without
** worrying about deadlock.
**
** The number of shared btrees will always be small (usually 0 or 1)
** so an insertion sort is an adequate algorithm here.
*/
sqlite-amalgamation.c view on Meta::CPAN
*/
/* Opcode: Prev P1 P2 * * *
**
** Back up cursor P1 so that it points to the previous key/data pair in its
** table or index. If there is no previous key/value pairs then fall through
** to the following instruction. But if the cursor backup was successful,
** jump immediately to P2.
**
** The P1 cursor must be for a real table, not a pseudo-table.
*/
case OP_Prev: /* jump */
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/SQLite.pm view on Meta::CPAN
DBD::SQLite::db->install_method('sqlite_progress_handler');
DBD::SQLite::db->install_method('sqlite_commit_hook');
DBD::SQLite::db->install_method('sqlite_rollback_hook');
DBD::SQLite::db->install_method('sqlite_update_hook');
DBD::SQLite::db->install_method('sqlite_set_authorizer');
DBD::SQLite::db->install_method('sqlite_backup_from_file');
DBD::SQLite::db->install_method('sqlite_backup_to_file');
DBD::SQLite::db->install_method('sqlite_backup_from_dbh');
DBD::SQLite::db->install_method('sqlite_backup_to_dbh');
DBD::SQLite::db->install_method('sqlite_enable_load_extension');
DBD::SQLite::db->install_method('sqlite_load_extension');
DBD::SQLite::db->install_method('sqlite_register_fts3_perl_tokenizer');
DBD::SQLite::db->install_method('sqlite_trace', { O => 0x0004 });
DBD::SQLite::db->install_method('sqlite_profile', { O => 0x0004 });
lib/DBD/SQLite.pm view on Meta::CPAN
the access attempt, or C<undef> if this access attempt is directly from
top-level SQL code.
=back
=head2 $dbh->sqlite_backup_from_file( $filename )
This method accesses the SQLite Online Backup API, and will take a backup of
the named database file, copying it to, and overwriting, your current database
connection. This can be particularly handy if your current connection is to the
special :memory: database, and you wish to populate it from an existing DB.
=head2 $dbh->sqlite_backup_to_file( $filename )
This method accesses the SQLite Online Backup API, and will take a backup of
the currently connected database, and write it out to the named file.
=head2 $dbh->sqlite_backup_from_dbh( $another_dbh )
This method accesses the SQLite Online Backup API, and will take a backup of
the database for the passed handle, copying it to, and overwriting, your current database
connection. This can be particularly handy if your current connection is to the
special :memory: database, and you wish to populate it from an existing DB.
You can use this to backup from an in-memory database to another in-memory database.
=head2 $dbh->sqlite_backup_to_dbh( $another_dbh )
This method accesses the SQLite Online Backup API, and will take a backup of
the currently connected database, and write it out to the passed database handle.
=head2 $dbh->sqlite_enable_load_extension( $bool )
Calling this method with a true value enables loading (external)
view all matches for this distribution
view release on metacpan or search on metacpan
*/
/* Opcode: Prev P1 P2 *
**
** Back up cursor P1 so that it points to the previous key/data pair in its
** table or index. If there is no previous key/value pairs then fall through
** to the following instruction. But if the cursor backup was successful,
** jump immediately to P2.
*/
case OP_Prev:
case OP_Next: {
Cursor *pC;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBD/Sys/Roadmap.pod view on Meta::CPAN
... like routing information, firewall states, ...
=item Health Information
like last backup time, backup sizes, database roles, login failures (system,
databases, ...)
=back
And there may be many, many more which can be collected via an SQL interface,
view all matches for this distribution
view release on metacpan or search on metacpan
/*
* TT_DEFAULT_BIND_TYPE_VALUE is now set to 0, which means that
* DBD::TimesTen will call SQLDescribeParam to find out what type of
* binding should be set. If SQLDescribeParam fails, then the bind type
* will be set to SQL_VARCHAR as a backup.
*
*/
#define TT_DEFAULT_BIND_TYPE_VALUE 0
/* BLOB's are not supported in TimesTen, do not enable this. */
view all matches for this distribution
view release on metacpan or search on metacpan
av_top_index|5.017009|5.003007|p
av_top_index_skip_len_mg|5.025010||Viu
av_undef|5.003007|5.003007|
av_unshift|5.003007|5.003007|
ax|5.003007|5.003007|
backup_one_GCB|5.025003||Viu
backup_one_LB|5.023007||Viu
backup_one_SB|5.021009||Viu
backup_one_WB|5.021009||Viu
bad_type_gv|5.019002||Viu
bad_type_pv|5.016000||Viu
BADVERSION|5.011004||Viu
BASEOP|5.003007||Viu
BhkDISABLE|5.013003||xV
view all matches for this distribution
view release on metacpan or search on metacpan
MANIFEST.SKIP view on Meta::CPAN
\bBuild.bat$
\bBuild.COM$
\bBUILD.COM$
\bbuild.com$
# Avoid temp and backup files.
~$
\.old$
\#$
\b\.#
\.bak$
view all matches for this distribution
view release on metacpan or search on metacpan
cci-src/config/ltmain.sh view on Meta::CPAN
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
linker_flags="$linker_flags $flag"
fi
# Make a backup of the uninstalled library when relinking
if test "$mode" = relink; then
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
fi
# Do each of the archive commands.
view all matches for this distribution
view release on metacpan or search on metacpan
{
my ($macenv, $macenvval) = split('=',$ARGV[0]);;
$ENV{$macenv} = $macenvval;
shift @ARGV;
}
open(OLDSTDERR, ">&STDERR") || die "Failed to backup STDERR: $!";
open(FILE, ">myld.stderr") || die "Failed to create myld.stderr: $!";
open(STDERR, ">&FILE") || die "Failed to redirect STDERR: $!";
my $retval = system(@ARGV);
open(STDERR, ">&OLDSTDERR");
view all matches for this distribution
view release on metacpan or search on metacpan
{
my ($macenv, $macenvval) = split('=',$ARGV[0]);;
$ENV{$macenv} = $macenvval;
shift @ARGV;
}
open(OLDSTDERR, ">&STDERR") || die "Failed to backup STDERR: $!";
open(FILE, ">myld.stderr") || die "Failed to create myld.stderr: $!";
open(STDERR, ">&FILE") || die "Failed to redirect STDERR: $!";
my $retval = system(@ARGV);
open(STDERR, ">&OLDSTDERR");
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBI/DBD.pm view on Meta::CPAN
Of special importance for B<DBI> drivers is the I<postamble> method from
the L<ExtUtils::MM_Unix> man page.
For Emacs users, I recommend the I<libscan> method, which removes
Emacs backup files (file names which end with a tilde '~') from lists of
files.
Now an example, I use the word C<Driver> wherever you should insert
your driver's name:
view all matches for this distribution
view release on metacpan or search on metacpan
examples/backup-db.pl view on Meta::CPAN
#!/usr/bin/perl
#
# Name:
# backup-db.pl.
use strict;
use warnings;
use DBI;
use DBIx::Admin::BackupRestore;
# -----------------------------------------------
my($file_name) = shift || die("Usage: perl backup-db.pl backup-db.xml");
my($driver) = ($^O eq 'MSWin32') ? 'mysql' : 'Pg';
my($dsn) = ($driver eq 'mysql') ? 'dbi:mysql:db_name' : 'dbi:Pg:dbname=db_name';
my($username) = ($driver eq 'mysql') ? 'root' : 'postgres';
my($password) = ($driver eq 'mysql') ? 'pass' : '';
my($dbh) = DBI -> connect
examples/backup-db.pl view on Meta::CPAN
skip_tables =>
[ # For exporting from MS Access only.
qw/msysaces msysaccessobjects msyscolumns msysimexcolumns msysimexspecs msysindexes msysmacros msysmodules2 msysmodules msysobjects msysqueries msysrelationships/
],
verbose => 1,
) -> backup('db_name');
close OUT;
view all matches for this distribution
view release on metacpan or search on metacpan
MANIFEST.SKIP view on Meta::CPAN
\bBuild.bat$
# Avoid Devel::Cover generated files
\bcover_db
# Avoid temp and backup files.
~$
\#$
\.#
\.bak$
\.old$
view all matches for this distribution
view release on metacpan or search on metacpan
MANIFEST.SKIP view on Meta::CPAN
\bBuild.bat$
# Avoid Devel::Cover generated files
\bcover_db
# Avoid temp and backup files.
~$
\#$
\.#
\.bak$
\.old$
view all matches for this distribution
view release on metacpan or search on metacpan
MANIFEST.SKIP view on Meta::CPAN
\bBuild.bat$
# Avoid Devel::Cover generated files
\bcover_db
# Avoid temp and backup files.
~$
\#$
\.#
\.bak$
\.old$
view all matches for this distribution
view release on metacpan or search on metacpan
doc/bk_faq.html view on Meta::CPAN
<p>
2. When a translation set is incomplete the missing
language descriptions will be filled in with the
'native' language. English may be a good choice for
the 'native' backup display language because many people
can understand it.
<p>
<div align="right">
view all matches for this distribution
view release on metacpan or search on metacpan
t/DBIx-Brev.t view on Meta::CPAN
my $mswin = $^O eq 'MSWin32';
my $fd = $mswin?q{\\}:q{/};
my ($home) = grep defined && -d, map $ENV{$_}, $mswin? qw(USERPROFILE HOME):'HOME';
skip "was not able to find HOME directory", 1 unless defined($home);
my $home_config = $home.$fd.q{dbi.conf};
my $backup = -f $home_config?grep(!-f,map $home_config.substr(rand(),1),1..10):();
my %config2;
skip "was not able to create/replace $home_config",1 unless eval {
move($home_config,$backup) if $backup;
move($config_file,$home_config);
%config2 = DBIx::Brev::load_config();
unlink $home_config;
move($backup,$home_config) if $backup;
1;
};
is_deeply(\%config2,\%config,q{load config from HOME directory});
};
unlink $config_file;
view all matches for this distribution
view release on metacpan or search on metacpan
- initial release to CPAN
0.05 2016-09-01T10:02:43Z
- removed to specific backup method
0.04 2016-09-01T09:47:35Z
- removed warnings
- deployment handler args fixed
- deployment handler args per new()
0.02 2016-09-01T09:04:28Z
- mysqldump backup WIP
0.01 2016-09-01T08:55:07Z
- original version
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/DeploymentHandler/Dad.pm view on Meta::CPAN
has schema => (
is => 'ro',
required => 1,
);
has backup_directory => (
isa => 'Str',
is => 'ro',
predicate => 'has_backup_directory',
);
has to_version => (
is => 'ro',
isa => 'Str',
lib/DBIx/Class/DeploymentHandler/Dad.pm view on Meta::CPAN
}
});
log_warn { 'no version to run downgrade' } unless $ran_once;
}
sub backup {
my $self = shift;
log_info { 'backing up' };
$self->schema->storage->backup($self->backup_directory)
}
__PACKAGE__->meta->make_immutable;
1;
lib/DBIx/Class/DeploymentHandler/Dad.pm view on Meta::CPAN
=head2 schema_version
The version that the schema is currently at. Defaults to
C<< $self->schema->schema_version >>.
=head2 backup_directory
The directory where backups are stored
=head2 to_version
The version (defaults to schema's version) to migrate the database to
lib/DBIx/Class/DeploymentHandler/Dad.pm view on Meta::CPAN
Downgrades the database one step at a time till L</previous_version_set>
returns C<undef>. Each downgrade step will delete a C<version> from the
version storage.
=head2 backup
$dh->backup
Simply calls backup on the C<< $schema->storage >>, passing in
C<< $self->backup_directory >> as an argument. Please test yourself before
assuming it will work.
=head1 AUTHOR
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/Fixtures.pm view on Meta::CPAN
=head2 external
In some cases your database information might be keys to values in some sort of
external storage. The classic example is you are using L<DBIx::Class::InflateColumn::FS>
to store blob information on the filesystem. In this case you may wish the ability
to backup your external storage in the same way your database data. The L</external>
attribute lets you specify a handler for this type of issue. For example:
{
"sets": [{
"class": "Photo",
lib/DBIx/Class/Fixtures.pm view on Meta::CPAN
}]
}
This would use L<DBIx::Class::Fixtures::External::File> to read from a directory
where the path to a file is specified by the C<file> field of the C<Photo> source.
We use the uninflated value of the field so you need to completely handle backup
and restore. For the common case we provide L<DBIx::Class::Fixtures::External::File>
and you can create your own custom handlers by placing a '+' in the namespace:
"class": "+MyApp::Schema::SomeExternalStorage",
lib/DBIx/Class/Fixtures.pm view on Meta::CPAN
$class = "DBIx::Class::Fixtures::External::$class" unless $plus;
eval "use $class";
$ds{external}->{$field} =
encode_base64( $class
->backup($key => $args),'');
}
}
# mess with dates if specified
if ($set->{datetime_relative}) {
view all matches for this distribution
view release on metacpan or search on metacpan
MANIFEST.SKIP view on Meta::CPAN
\bBuild$
\b_build
Build.PL
Build.bat
# Avoid temp and backup files.
~$
\.gz$
\.old$
\.bak$
\.swp$
view all matches for this distribution
view release on metacpan or search on metacpan
MANIFEST.SKIP view on Meta::CPAN
# Avoid Module::Build generated and utility files.
\bBuild$
\b_build/
# Avoid temp and backup files.
~$
\.old$
\#$
\b\.#
\.bak$
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/Migration.pm view on Meta::CPAN
Run down files to bring the database down to the previous version from what is
installed to the database
=head2 drop_tables
Drops all the tables in the connected database with no backup or recovery. For
real! (Make sure you are not connected to Prod, for example).
=head2 delete_table_rows
Does a C<delete> on each table in the database, which clears out all your data
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/Storage/DBI/mysql/backup.pm view on Meta::CPAN
=encoding utf8
=head1 NAME
DBIx::Class::Storage::DBI::mysql::backup
=head1 SYNOPSIS
package MyApp::Schema;
use base qw/DBIx::Class::Schema/;
lib/DBIx/Class/Storage/DBI/mysql/backup.pm view on Meta::CPAN
our $VERSION = 0.001;
__PACKAGE__->load_classes(qw/CD Book DVD/);
__PACKAGE__->load_components(qw/
Schema::Versioned
Storage::DBI::mysql::backup
/);
=head1 DESCRIPTION
Adds C<backup> method to L<DBIx::Class::Storage::DBI::mysql>.
This plugin enables L<DBIx::Class::Schema::Versioned/backup> when using MySQL.
=head1 FUNCTIONS
=cut
package DBIx::Class::Storage::DBI::mysql::backup;
use strict;
use warnings;
use DBIx::Class::Storage::DBI;
lib/DBIx/Class/Storage/DBI/mysql/backup.pm view on Meta::CPAN
use vars qw( $VERSION );
$VERSION = '0.04';
=head2 backup ( $to_dir )
writes SQL file as L</backup_filename> to $to_dir. returns SQL filename.
=cut
sub _backup {
my ( $self, $dir ) = @_;
mkpath([$dir]) unless -d $dir;
my $filename = $self->backup_filename;
my $fh = Symbol::gensym();
open $fh, ">$dir/$filename";
print $fh $self->dump;
close $fh;
$filename
}
=head2 backup_filename
returns filename of backup I<$DB_NAME-YYYYMMDD-hhmmss.sql>
=cut
sub _backup_filename {
my $self = shift;
my $dsn = $self->_dbi_connect_info->[0];
my $dbname = $1 if($dsn =~ /^dbi:mysql:database=([^;]+)/i);
unless($dbname) {
$dbname = $1 if($dsn =~ /^dbi:mysql:dbname=([^;]+)/i);
lib/DBIx/Class/Storage/DBI/mysql/backup.pm view on Meta::CPAN
=cut
sub _dump {
my $self = shift;
my $mb = MySQL::Backup->new_from_DBH( $self->dbh ,{'USE_REPLACE' => 1, 'SHOW_TABLE_NAMES' => 1});
$mb->create_structure() . $mb->data_backup()
}
*DBIx::Class::Storage::DBI::dump = \&_dump;
*DBIx::Class::Storage::DBI::backup = \&_backup;
*DBIx::Class::Storage::DBI::backup_filename = \&_backup_filename;
1;
__END__
view all matches for this distribution
view release on metacpan or search on metacpan
MANIFEST.SKIP view on Meta::CPAN
\bBuild$
\b_build
Build.PL
Build.bat
# Avoid temp and backup files.
~$
\.gz$
\.old$
\.bak$
\.swp$
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/Schema/Versioned.pm view on Meta::CPAN
use Scalar::Util 'weaken';
use namespace::clean;
__PACKAGE__->mk_classdata('_filedata');
__PACKAGE__->mk_classdata('upgrade_directory');
__PACKAGE__->mk_classdata('backup_directory');
__PACKAGE__->mk_classdata('do_backup');
__PACKAGE__->mk_classdata('do_diff_on_init');
=head1 METHODS
=head2 upgrade_directory
Use this to set the directory your upgrade files are stored in.
=head2 backup_directory
Use this to set the directory you want your backups stored in (note that backups
are disabled by default).
=cut
=head2 install
lib/DBIx/Class/Schema/Versioned.pm view on Meta::CPAN
return;
}
carp "DB version ($db_version) is lower than the schema version (".$self->schema_version."). Attempting upgrade.\n";
# backup if necessary then apply upgrade
$self->_filedata($self->_read_sql_file($upgrade_file));
$self->backup() if($self->do_backup);
$self->txn_do(sub { $self->do_upgrade() });
# set row in dbix_class_schema_versions table
$self->_set_db_version({version => $target_version});
}
lib/DBIx/Class/Schema/Versioned.pm view on Meta::CPAN
Returns the current schema class' $VERSION
=cut
=head2 backup
This is an overwritable method which is called just before the upgrade, to
allow you to make a backup of the database. Per default this method attempts
to call C<< $self->storage->backup >>, to run the standard backup on each
database type.
This method should return the name of the backup file, if appropriate..
This method is disabled by default. Set $schema->do_backup(1) to enable it.
=cut
sub backup
{
my ($self) = @_;
## Make each ::DBI::Foo do this
$self->storage->backup($self->backup_directory());
}
=head2 connection
Overloaded method. This checks the DBIC schema version against the DB version and
view all matches for this distribution