Skip to content

Commit

Permalink
Add release updates
Browse files Browse the repository at this point in the history
  • Loading branch information
iamalnewkirk committed Jan 14, 2021
1 parent b9e3b0a commit 7d7cbf5
Show file tree
Hide file tree
Showing 7 changed files with 301 additions and 47 deletions.
36 changes: 0 additions & 36 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,37 +1 @@
Changelog for Test-DB

0.06 2020-08-13T12:06:42
- Add release updates
- Include TESTDB_TEMPLATE in driver descriptions (#21)
- Include example for MSSQL, and POD taglines for all (#20)

0.05 2020-08-12T21:54:22
- Built release version 0.05
- Add release updates
- Implement support for MSSQL (#16)
- Update .gitattributes

0.04 2020-08-10T03:49:17
- Built release version 0.04
- Add release updates
- Cleanup and re-launch

0.03 2020-04-09T20:02:31
- Built release version 0.03
- Added release updates
- Fix META data
- Allow clone for SQLite and Postgres
- Add examples
- Add META data
- Enable auto-commit which allows DDL statements

0.02 2020-04-05T00:47:11
- Built release version 0.02
- Added release updates
- Update documentation

0.01 2020-04-05T00:17:37
- Built release version 0.01
- Added release updates
- Initial implementation
- Initial commit
8 changes: 4 additions & 4 deletions META.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"web" : "https://github.com/iamalnewkirk/test-db/issues"
"web" : "https://github.com/cpanery/test-db/issues"
},
"homepage" : "https://metacpan.org/release/Test-DB",
"repository" : {
"type" : "git",
"url" : "git://github.com/iamalnewkirk/test-db.git",
"web" : "https://github.com/iamalnewkirk/test-db"
"url" : "git://github.com/cpanery/test-db.git",
"web" : "https://github.com/cpanery/test-db"
}
},
"version" : "0.06",
"version" : "0.07",
"x_authority" : "cpan:AWNCORP",
"x_generated_by_perl" : "v5.32.0",
"x_serialization_backend" : "Cpanel::JSON::XS version 4.19",
Expand Down
6 changes: 3 additions & 3 deletions META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ requires:
strict: '0'
warnings: '0'
resources:
bugtracker: https://github.com/iamalnewkirk/test-db/issues
bugtracker: https://github.com/cpanery/test-db/issues
homepage: https://metacpan.org/release/Test-DB
repository: git://github.com/iamalnewkirk/test-db.git
version: '0.06'
repository: git://github.com/cpanery/test-db.git
version: '0.07'
x_authority: cpan:AWNCORP
x_generated_by_perl: v5.32.0
x_serialization_backend: 'YAML::Tiny version 1.73'
Expand Down
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ my %WriteMakefileArgs = (
"strict" => 0,
"warnings" => 0
},
"VERSION" => "0.06",
"VERSION" => "0.07",
"test" => {
"TESTS" => "t/*.t"
}
Expand Down
147 changes: 146 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,104 @@ DESCRIPTION
temporary databases for testing purposes. This framework requires a
user (optionally with password) which has the ability to create new
databases and works by creating test-specific databases owned by the
user specified.
user specified. Note: Test databases are not automatically destroyed
and should be cleaned up manually by call the destroy method on the
database-specific test database object.

process

on create, clone

#1

Establish a connection to the DB using some "initial" database.

my $tdbo = $tdb->postgres(initial => 'template0');

#2

Using the established connection, create the test/temporary database.

$tdbo->create;

#3

Establish a connection to the newly created test/temporary database.

$tdbo->create->dbh;

#4

Make the test database object immutable.

$tdbo->create->database('example'); # error

on destroy

#1

Establish a connection to the DB using the "initial" database.

# using the created test/temporary database object

#2

Using the established connection, drop the test/temporary database.

$tdbo->destroy;

usages

using DBI

#1

my $tdb = Test::DB->new;
my $dbh = $tdb->sqlite(%options)->dbh;

using DBIx::Class

#1

my $tdb = Test::DB->new;
my $tdbo = $tdb->postgres(%options)->create;
my $schema = DBIx::Class::Schema->connect(
dsn => $tdbo->dsn,
username => $tdbo->username,
password => $tdbo->password,
);

using Mojo::mysql

#1

my $tdb = Test::DB->new;
my $tdbo = $tdb->mysql(%options)->create;
my $mysql = Mojo::mysql->new($tdbo->uri);

using Mojo::Pg

#1

my $tdb = Test::DB->new;
my $tdbo = $tdb->postgres(%options)->create;
my $postgres = Mojo::Pg->new($tdbo->uri);

using Mojo::Pg (with cloning)

#1

my $tdb = Test::DB->new;
my $tdbo = $tdb->postgres(%options)->clone('template0');
my $postgres = Mojo::Pg->new($tdbo->uri);

using Mojo::SQLite

#1

my $tdb = Test::DB->new;
my $tdbo = $tdb->sqlite(%options)->create;
my $sqlite = Mojo::SQLite->new($tdbo->uri);

LIBRARIES

Expand Down Expand Up @@ -105,6 +202,54 @@ METHODS

$tdb->create(database => 'sqlite');

mssql

mssql(Str %options) : Maybe[InstanceOf["Test::DB::Object"]]

The mssql method builds and returns a Test::DB::Mssql object.

mssql example #1

# given: synopsis

$tdb->mssql;

mysql

mysql(Str %options) : Maybe[InstanceOf["Test::DB::Object"]]

The mysql method builds and returns a Test::DB::Mysql object.

mysql example #1

# given: synopsis

$tdb->mysql;

postgres

postgres(Str %options) : Maybe[InstanceOf["Test::DB::Object"]]

The postgres method builds and returns a Test::DB::Postgres object.

postgres example #1

# given: synopsis

$tdb->postgres;

sqlite

sqlite(Str %options) : Maybe[InstanceOf["Test::DB::Object"]]

The sqlite method builds and returns a Test::DB::Sqlite object.

sqlite example #1

# given: synopsis

$tdb->sqlite;

AUTHOR

Al Newkirk, [email protected]
Expand Down
Loading

0 comments on commit 7d7cbf5

Please sign in to comment.