12 years agorelease 0.07022 0.07022
Rafael Kitover [Sun, 8 Apr 2012 12:24:14 +0000]
release 0.07022

12 years agoseparate queries for default on ASE (RT#74170)
Paul C. Mantz [Tue, 24 Jan 2012 22:53:02 +0000]
separate queries for default on ASE (RT#74170)

Some Sybase ASE servers apparently cannot LEFT JOIN to the syscomments
table to get the default_value, so do the query separately.

Also combine the data_type/len/prec. and is_identity queries.

12 years agoset correct size for n(var)?char columns for ASE
Rafael Kitover [Sat, 7 Apr 2012 18:22:29 +0000]
set correct size for n(var)?char columns for ASE

Based on @@ncharsize.

12 years agomake common tests use fewer active statements
Rafael Kitover [Sat, 7 Apr 2012 17:47:19 +0000]
make common tests use fewer active statements

Newer versions of the Sybase ASE developer's edition have a limit of 25
user connections and do not allow setting it higher, this did not
support the common tests.

Change the ->first calls on ResultSets to ->single to not keep active
statements around.

The common tests now run against the latest version of Sybase ASE
developer's edition.

12 years agosupport Informix common tests over shared mem
Rafael Kitover [Fri, 6 Apr 2012 16:08:39 +0000]
support Informix common tests over shared mem

Support the default Informix connections over shared memory rather than
TCP for running the common tests, including the extra tests.

Shared memory connections have the limitation that a process may only
open one connection to the DB server at a time.

Also fix the t/lib/dbixcsl_common_tests.pm to work with only one
database connection at a time.

12 years agorelease 0.07021 0.07021
Rafael Kitover [Wed, 4 Apr 2012 23:57:57 +0000]
release 0.07021

12 years agoregister sources on schema class, never instance
Rafael Kitover [Wed, 4 Apr 2012 23:25:11 +0000]
register sources on schema class, never instance

Change _invoke_loader in Loader.pm to always invoke the loader on the
Schema class, never the instance, even if an instance is passed in, and
then merge the state of the class into the instance if necessary.

Fix up a couple of tests to work with this new logic.

Also change make_schema_at to use ->connect instead of ->connection
because of people relying on instance state in ->connection (RT#74175),
being careful to copy the storage back to the Schema class.

12 years agorelease 0.07020 0.07020
Rafael Kitover [Mon, 2 Apr 2012 01:41:29 +0000]
release 0.07020

12 years agofix mro issues under 5.8
Rafael Kitover [Fri, 30 Mar 2012 17:51:43 +0000]
fix mro issues under 5.8

Add a Class::C3::reinitialize() under 5.8 after the ::DBI ->_rebless.

Also make sure MRO::Compat is loaded everywhere it needs to be and
everything does a use mro 'c3';.

12 years agorelease 0.07019 0.07019
Rafael Kitover [Thu, 29 Mar 2012 01:50:47 +0000]
release 0.07019

Also remove a leftover ->_lc call in ::DBI::_columns_info_for that was
screwing things up.

12 years agoaudit drivers for case issues (RT#75805)
Rafael Kitover [Wed, 28 Mar 2012 00:16:08 +0000]
audit drivers for case issues (RT#75805)

Add missing ->_lc calls to MSSQL driver in _table_pk_info and
_table_fk_info, and rework use of column name in queries in
_columns_info_for based on the value of _preserve_case. This fixes the
RT in question, as tested with the DDL provided by the reporter.

Fix collation detection in MSSQL driver when in a database other than
master by changing 'sys.databases' to '[$db].sys.databases' and doing a
"use [$db]" beforehand (with a warning silencing fixup for ADO.)

Check for collisions of columns like 'Foo' and 'fOO' in preserve_case=0
mode in ::DBI::_columns_info_for and throw an exception if detected.

UNRELATED CLEANUP: Remove warning fixups for _table_comment and
_column_comment from Access and MSSQL ADO drivers as we now check for
the existance of the comment tables.

Add missing ->_lc call in Pg _table_uniq_info, which was only for very
old versions of DBD::Pg anyway.

In _columns_info_for in the SQL Anywhere driver, fold the column names in
queries to lower case, as SQL Anywhere is case preserving, but not case
sensitive.

In _columns_info_for in the SQLite driver, map the column names from the
table_info pragma to the ->_lc versions.

Fold column names to lowercase in the mysql driver's _columns_info_for
as MySQL is case preserving but not case sensitive for column names.

12 years agorelease 0.07018 0.07018
Rafael Kitover [Tue, 27 Mar 2012 06:53:16 +0000]
release 0.07018

12 years agoskip dbicdump tests on Win32 due to test fails
Rafael Kitover [Sun, 25 Mar 2012 20:14:33 +0000]
skip dbicdump tests on Win32 due to test fails

t/23dumpmore.t and t/26dump_use_moose.t fail on Win32 with some types of
refs and characters  in -o params to dbicdump because of quoting issues.

There is currently no module like String::ShellQuote for Win32, haarg is
releasing Win32::ShellQuote soon, and then I will reenable these tests.

Also the fucking pigs completely fucked up my windows computer and when
I was trying to run some tests with dbicdump I got constant perl hangs,
so I cannot debug this right now and I disabled ALL dbicdump tests on
Win32.

I removed the reference to the FUCKING_PIGS environment variable
because, at least, the behavior of the tests is now at least consistent
with that of other machines, or was, except for the perl hangs I'm
getting now, and because I'm making this skip for all dbicdump tests,
not just those with refs so it is in the same part of the code, so might
as well.

12 years agoChanges entry for "fix undef warn in fk info"
Rafael Kitover [Tue, 27 Mar 2012 05:39:41 +0000]
Changes entry for "fix undef warn in fk info"

12 years agofix undef warn in fk info for DBDs without schemas
Rafael Kitover [Wed, 14 Mar 2012 18:10:26 +0000]
fix undef warn in fk info for DBDs without schemas

SineSwiper reported an undef warning from ::DBI in _table_fk_info
because of an s/// substitution on the schema values extracted from
$dbh->foreign_key_info, which can be undef for DBDs which do not have
the concept of schemas.

Change the substitution to only run if the values are defined.

12 years agowork around ORA-24345 from $dbh->column_info
Rafael Kitover [Fri, 30 Dec 2011 19:48:08 +0000]
work around ORA-24345 from $dbh->column_info

jhannah reported getting ORA-24345: A Truncation or null fetch error
occurred (DBD ERROR: ORA-01406 error on field 13 of 18, ora_type 8,
 LongReadLen too small and/or LongTruncOk not set)

on running the loader on a table with a very long DEFAULT of
"to_number(decode(substrb(userenv('CLIENT_INFO'),1,1),' ',
null,substrb(userenv('CLIENT_INFO'),1,10)))"

The fix is simply setting $dbh->{LongReadLen} in the _dbh_column_info
override for ::DBI::Oracle, but also make it work without the setting by
making the code involved much more robust.

Change Loader/DBI to fall back to the non-column_info code (that does a
 SELECT ... WHERE 1=0 and examines the $sth) when $dbh->column_info
fails in _columns_info_for, and wrap the fetchrow_hashref in a try {}
catch { +{} }; then skip columns where fetchrow_hashref fails and fill
them in from the WHERE 1=0 type_info code.

Also use this method instead of $dbh->column_info in Loader/DBI/Oracle
_table_columns by removing the overloaded method and using the
Loader/DBI implementation.

While there, clean up the _table_columns implementation in Loader/DBI to
use $self->_lc insetad of $sth->{NAME_lc} for consistency and
overridability.

Make the ::DBI::Oracle _columns_info_for pass all tests with both the
$dbh->column_info output and the type_info output from the parent ::DBI.

12 years agofix spelling mistake in Base POD (RT#74796)
Rafael Kitover [Fri, 10 Feb 2012 06:07:24 +0000]
fix spelling mistake in Base POD (RT#74796)

12 years agorelease 0.07017 0.07017
Rafael Kitover [Tue, 7 Feb 2012 17:08:28 +0000]
release 0.07017

12 years agoexperimental support for Pg loader run inside txn
Rafael Kitover [Tue, 7 Feb 2012 00:31:42 +0000]
experimental support for Pg loader run inside txn

To get this to work, there must not be any database errors thrown. So we
cannot use our usual technique of selecting from nonexistant tables and
throwing away the errors.

To that end, _table_comment and _column_comment in ::Loader::DBI now
check for the tables in $self->_tables before doing a query on them.

jnap added a test to the common tests in a previous commit which I
augment here to be $TODO for DBs other than Pg and to throw away the
usual rescan warnings.

There is also a warning for 'commit ineffective with AutoCommit enabled'
which we also throw away and is more worrisome, and will need further
attention, and is one of the reason this support is marked experimental.
That and this test failing for SQLite as well as some other DBs.

12 years agofailing test for dumping schema inside a txn
John Napiorkowski [Mon, 6 Feb 2012 19:13:50 +0000]
failing test for dumping schema inside a txn

12 years agoadd files created by Mac OS X to .gitignore
John Napiorkowski [Mon, 6 Feb 2012 19:12:41 +0000]
add files created by Mac OS X to .gitignore

12 years agoadd SineSwiper to CONTRIBUTORS
Rafael Kitover [Sun, 22 Jan 2012 19:13:53 +0000]
add SineSwiper to CONTRIBUTORS

12 years agoIgnore metas
Peter Rabbitson [Thu, 19 Jan 2012 10:29:04 +0000]
Ignore metas

12 years agoFix minor $dbh var adjustments
Brendan Byrd [Mon, 9 Jan 2012 14:28:29 +0000]
Fix minor $dbh var adjustments

12 years agoAdd support for REMARKS in *_info to use for *_comments
Brendan Byrd [Fri, 6 Jan 2012 23:30:42 +0000]
Add support for REMARKS in *_info to use for *_comments

12 years agoChange all for@ loops to safer foreach loops (Base.pm)
Brendan Byrd [Thu, 5 Jan 2012 21:12:04 +0000]
Change all for@ loops to safer foreach loops (Base.pm)

Change all for@ loops to safer foreach loops that don't clobber $_
(and thus @tables) because non-DCSL::DBI::* DBDs fail on
_setup_src_meta.

12 years agorelease 0.07015 0.07015
Rafael Kitover [Fri, 9 Dec 2011 12:25:14 +0000]
release 0.07015

12 years agomany_to_many rel bridge generation for link tables
Rafael Kitover [Fri, 9 Dec 2011 08:57:51 +0000]
many_to_many rel bridge generation for link tables

For tables that have 2 FKs whose only columns are members of the FKs,
and having all columns in the PK, many_to_many relationship bridges are
now generated for the referred to classes.

12 years agorelease 0.07014 0.07014
Rafael Kitover [Fri, 18 Nov 2011 17:53:22 +0000]
release 0.07014

12 years agomake copy of moniker_parts in disambiguation code
Rafael Kitover [Fri, 18 Nov 2011 17:03:24 +0000]
make copy of moniker_parts in disambiguation code

The local $self->{moniker_parts} code did not make a copy of
$self->moniker_parts before unshifting to it, so modifications were made
to the original reference, breaking ->rescan.

12 years agorelease 0.07013 0.07013
Rafael Kitover [Fri, 18 Nov 2011 00:00:53 +0000]
release 0.07013

12 years agoadd notes about table object stringify to name
Rafael Kitover [Thu, 17 Nov 2011 23:08:11 +0000]
add notes about table object stringify to name

Add notes to the POD for callbacks that the table object parameter
stringifies to the unqualified table name, also add a note to the
::Table POD.

12 years agoauto-disambiguate monikers from different schemas
Rafael Kitover [Thu, 17 Nov 2011 21:03:06 +0000]
auto-disambiguate monikers from different schemas

Automatically prefix schema and/or database to clashing monikers for the
same table name from different schemas/databases.

Update docs to reflect this behavior.

Also rewrite all the multischema tests to use this new feature instead
of explicit moniker_parts.

12 years agorelease 0.07012 0.07012
Rafael Kitover [Wed, 9 Nov 2011 15:19:28 +0000]
release 0.07012

12 years agoupdate docs for callbacks receiving table objects
Rafael Kitover [Wed, 9 Nov 2011 15:11:32 +0000]
update docs for callbacks receiving table objects

Update docs for callbacks like custom_column_info to say that they now
receive a table object (e.g. ::Loader::Table) rather than the table
name (RT##72260).

12 years agoupdate SEE ALSO section of Loader.pm
Rafael Kitover [Wed, 9 Nov 2011 14:43:40 +0000]
update SEE ALSO section of Loader.pm

Add links to Intro, Tutorial and Loader::Base.

12 years agobetter cleanup of t/var
Rafael Kitover [Wed, 9 Nov 2011 14:29:55 +0000]
better cleanup of t/var

Add an END action in t/lib/dbixcsl_test_dir.pm to delete t/var, first
closing any open DBI handles because if there is an open SQLite handle
to a .db file in that dir, the .db file cannot be removed on Win32. Also
copy the file to t/backcompat/0.04006/lib/dbixcsl_test_dir.pm.

Also add t/var to MANIFEST.SKIP just in case.

12 years agofix code running 2x in dynamic schema_base_class
Rafael Kitover [Wed, 9 Nov 2011 02:33:46 +0000]
fix code running 2x in dynamic schema_base_class

Fix a bug that ran the connection method in
schema_base_class/schema_components twice on the second connect, with
tests.

Move the RelBuilder _array_eq method to an array_eq sub in Utils.

12 years agouse temp file instead of IPC::Open2 for Win32
Rafael Kitover [Tue, 8 Nov 2011 15:43:48 +0000]
use temp file instead of IPC::Open2 for Win32

Change implementation of filter_generated_code with a string for program
name from IPC::Open2 to File::Temp with redirection, because this code
was hanging on Win32 (RT#72226).

12 years agoadd correction to Changes for wrong RT#
Rafael Kitover [Tue, 1 Nov 2011 12:41:10 +0000]
add correction to Changes for wrong RT#

uniq_to_primary option fixes RT#51696, not RT#25944.

12 years agorelease 0.07011 0.07011
Rafael Kitover [Tue, 1 Nov 2011 10:54:30 +0000]
release 0.07011

12 years agofix some warnings for MSSQL over ADO
Rafael Kitover [Tue, 1 Nov 2011 01:52:59 +0000]
fix some warnings for MSSQL over ADO

Fix invalid object warnings for nonexistant table/comment tables, and
"Changed context" warnings for the extra database tests.

12 years agoadd -I option to dbicdump
Rafael Kitover [Mon, 31 Oct 2011 13:50:43 +0000]
add -I option to dbicdump

Add an -I option to dbicdump to add things to @INC during the dump, like
perl's -I option (see perldoc perlrun.)

For the config file dbicdump format, add the 'lib' key that is the
equivalent of the -I option.

Add error checking to ::Utils slurp_file and write_file subs in the open
calls.

Add alnewkirk to list of CONTRIBUTORS for dbicdump.

12 years agoremove duplicate from Changes
Rafael Kitover [Mon, 31 Oct 2011 09:55:08 +0000]
remove duplicate from Changes

12 years agostop editing custom content from renamed files
Rafael Kitover [Sun, 30 Oct 2011 00:40:04 +0000]
stop editing custom content from renamed files

Remove an unnecessary bit of cleverness that was removing the default
custom content comment (# You can replace...) from files that are being
renamed for an upgrade (either to singularization or use_namespaces.)

This fixes RT#70507.

12 years agoadd attribution for alnewkirk, mention force_ascii
Rafael Kitover [Sat, 29 Oct 2011 20:26:05 +0000]
add attribution for alnewkirk, mention force_ascii

Add attribution for the dbicdump config file support for alnewkirk in
Changes and add his handle in ::Loader CONTRIBUTORS section.

Add naming => { force_ascii => 1 } to Changes as well.

12 years agoupdate Changes with MooseX::MarkAsMethods
Rafael Kitover [Sat, 29 Oct 2011 18:22:25 +0000]
update Changes with MooseX::MarkAsMethods

12 years agoupdate Changes for naming=v8
Rafael Kitover [Sat, 29 Oct 2011 18:18:54 +0000]
update Changes for naming=v8

12 years agocommon tests for schema_base_class and components
Rafael Kitover [Sat, 29 Oct 2011 18:08:53 +0000]
common tests for schema_base_class and components

Test calling schema_components methods and test schema_base_class in the
common tests.

12 years agobetter CamelCASE support for naming=v8
Rafael Kitover [Sat, 29 Oct 2011 17:29:27 +0000]
better CamelCASE support for naming=v8

The previous method of splitting CamelCase identifiers did not work
identifiers containing words in all caps, such as 'VLANValidID'.

Use 'wordsplit' from String::CamelCase which handles these types of
identifiers correctly for naming=v8 mode, while preserving the old
behavior for v7 mode for monikers, column accessors and relationship
names.

New features related to multischema support also use the v8 mode
implicitly.

Add t/80split_name.t to test the 'split_name' utility sub from ::Utils,
at the heart of this change; for both v8 and v7 modes.

12 years agoupdate use_moose docs and opt deps
Rafael Kitover [Sat, 29 Oct 2011 08:59:40 +0000]
update use_moose docs and opt deps

Add namespace::autoclean as an optional dep for use_moose. Even though
it is a dependency of MooseX::MarkAsMethods, we want to list it
explicitly.

Update use_moose and only_autoclean POD to say that the overloads being
protected are operator overloads.

12 years agonamespace::autoclean to MooseX::MarkAsMethods
Chris Weyl [Sun, 2 Oct 2011 02:38:52 +0000]
namespace::autoclean to MooseX::MarkAsMethods

Use MooseX::MarkAsMethods with autoclean => 1 instead of
namespace::autoclean for the use_moose option, to protect operator
overloads.

Add an only_autoclean option to use namespace::autoclean as before.

12 years agofix some naming version checks
Rafael Kitover [Sat, 29 Oct 2011 08:26:33 +0000]
fix some naming version checks

Previous code didn't take into account that naming->{key} can be set to
something other than vX.

Fix a call to ->_to_identifier in the monikerization code.

t/23dumpmore.t passes again.

12 years agofix double backcompat warning
Rafael Kitover [Fri, 28 Oct 2011 23:11:28 +0000]
fix double backcompat warning

Set naming and use_namespaces in the temp loader used in ::Loader to get
the schema_base_class and schema_components so that no backcompat check
is done and warning isn't issued.

12 years agofix uninitialized warning
Rafael Kitover [Fri, 28 Oct 2011 17:05:25 +0000]
fix uninitialized warning

Change the temporary loader used to extract the schema_base_class and
schema_components to be created with the schema => $self arg, so the
constructor (and _check_back_compat) can read the Schema.pm.

12 years agoupdate Changes with schema_base_class fix
Rafael Kitover [Fri, 28 Oct 2011 16:46:01 +0000]
update Changes with schema_base_class fix

12 years agobetter dynamic schema_base_class implementation
Rafael Kitover [Fri, 28 Oct 2011 16:43:41 +0000]
better dynamic schema_base_class implementation

Remove the restriction that dynamic schemas can't define a connection
method by finding the next method to call in mro::get_linear_isa.

12 years agouse connection hack only for schema_base_class
Rafael Kitover [Tue, 25 Oct 2011 20:56:48 +0000]
use connection hack only for schema_base_class

Use the horrible mro hack in ::Loader::connection only if
schema_base_class and/or schema_components were defined.

Add warnings to the POD for these options that dynamic schemas cannot
define a connection method.

12 years agobump String::ToIdentifier::EN dep to 0.05
Rafael Kitover [Tue, 25 Oct 2011 19:58:23 +0000]
bump String::ToIdentifier::EN dep to 0.05

0.04 has some horrible bugs, this is the first version that works
reasonably well.

12 years agoimplement schema_base_class for dynamic schemas
Rafael Kitover [Tue, 25 Oct 2011 10:55:39 +0000]
implement schema_base_class for dynamic schemas

Implement schema_base_class and schema_components support for dynamic
schemas at 'connection' time.

Augment btilly's test to check that schema_components are also applied
at 'connection' time.

This requires a rather horrible hack in ::Loader::connection, because
mro cannot normally deal with a changing @ISA inside of a call chain,
but it works.

12 years agotest for connecting through schema_base_class
Ben Tilly [Sat, 9 Jul 2011 19:24:57 +0000]
test for connecting through schema_base_class

Add test for applying schema_base_class to dynamic schemas at
'connection' time.

12 years agoupdate DBIx::Class::Schema::Loader POD
Rafael Kitover [Tue, 25 Oct 2011 11:12:42 +0000]
update DBIx::Class::Schema::Loader POD

Update list of supported DBDs and minimum necessary DBIx::Class version.
Remove the admonition that this module is for simple situations only.
Add link to ::Loader::Base for options.

12 years agoadd 'ALL' key for naming hash
Rafael Kitover [Mon, 24 Oct 2011 21:24:04 +0000]
add 'ALL' key for naming hash

Because I earlier added the 'force_ascii' parameter for the naming hash,
I now add the 'ALL' key to set 'relationships', 'monikers' and
'column_accessors' in one shot. This lets you do:

    naming => { ALL => 'v8', force_ascii => 1 }

12 years agofully implement naming=v8 and force_ascii
Rafael Kitover [Sun, 23 Oct 2011 01:39:35 +0000]
fully implement naming=v8 and force_ascii

Use String::ToIdentifier::EN or ::Unicode on column accessors and
relationship accessors as well as monikers, for the experimental v8
naming mode.

12 years agoupdate comment table support for multi-db_schema
Rafael Kitover [Fri, 21 Oct 2011 16:59:17 +0000]
update comment table support for multi-db_schema

Update the POD related to the table_comments and column_comments tables
to note that these tables must be in the same database and schema as the
tables they are describing.

Add a clone method to ::DBObject and use it to find the comment tables,
changing just the table name to table_comments_table or
column_comments_table.

12 years agobetter rel postfix stripping for v8 mode
Rafael Kitover [Wed, 7 Jul 2010 23:19:07 +0000]
better rel postfix stripping for v8 mode

Change the _id stripping in ::RelBuilder to strip other things as well,
like Id, ref, cd, code, _num.

This is only activated for the experimental { naming => 'v8' } mode.

12 years agofix no table warnings for MS Access over DBD::ADO
Rafael Kitover [Thu, 20 Oct 2011 11:08:40 +0000]
fix no table warnings for MS Access over DBD::ADO

The _table_comment and _column_comment methods in ::DBI do queries on
the 'table_comments' and 'column_comments' tables for getting
table/column comments in databases which do not support them natively
(or well.) These tables usually do not exist.

DBD::ADO throws a warning from Win32::OLE when it encounters a query on
a table that does not exist. Here we trap and ignore those warnings for
the comments tables.

12 years agofix some issues with multi-db_schema support
Rafael Kitover [Wed, 28 Sep 2011 16:28:05 +0000]
fix some issues with multi-db_schema support

Fix unique constraint detection for Oracle in multischema setups
(RT#70851) previously identically named tables in different schemas with
an identically named unique constraint would cause the columns in the
constraint definition to be repeated. Modifies the multischema extra
tests for all databases to test for the correctness of the dumped unique
constraint.

Update Oracle multischema extra tests to include the complete set of
test cases used in multischema test sets for other databases.

Update Oracle is_auto_increment detection code to work in multischema
setups. The new logic is by necessity fuzzier, please report false
positives to RT. At some point this will get rewritten to use a PL/SQL
parser on the trigger code.

Add a test for the miscaching of table keys when there are identically
named tables in different schemas for all databases. This was fixed for
MySQL in master.

Completely rewrite the table monikerization code to work better with
moniker_parts, preserving the functionality of all naming versions.
Schema/database names are transformed to parts of the moniker name using
String::ToIdentifier::EN::Unicode (or String::ToIdentifier::EN if

  naming => { force_ascii => 1 }

is set.) to translate non-identifier characters.

Add the next naming version, v8 as an experimental mode. In this mode,
the table names go through String::ToIdentifier::EN::Unicode as
well, instead of non-identifier characters being stripped out.

The clashing monikers error message is updated to mention moniker_parts
in multischema configurations.

The ::RelBuilder duplicate relationship name disambiguator has been
updated to handle the case of relationships in the same class pointing
to identically named tables in different schemas/databases.

Improve the multischema extra tests to include an identically named
table in both schemas and to use moniker_parts. This also reduces the
chances of moniker clashes on a tester's database.

Change the multidatabase tests to test both

    db_schema => { db1 => '%', db2 => '%' }

and

    db_schema => { '%' => '%' }

as well as to include an identically named table.

12 years agofix uninitialized warnings for Firebird
Rafael Kitover [Wed, 19 Oct 2011 20:58:43 +0000]
fix uninitialized warnings for Firebird

Check if the character_set_id for a column is NULL before comparing it
to a value to fix uninitialized warnings in the tests.

12 years agoignore type_info errors from DBD::Sybase+MSSQL
Rafael Kitover [Wed, 19 Oct 2011 20:52:06 +0000]
ignore type_info errors from DBD::Sybase+MSSQL

When testing multi-database schemas on MSSQL, a weird error comes up
from type_info_all in DBD::Sybase. This needs to be investigated
further, but for now the call to type_info in ::DBI is wrapped in a try.

12 years agoremove placeholders from tab/col comments queries
Rafael Kitover [Wed, 19 Oct 2011 20:46:09 +0000]
remove placeholders from tab/col comments queries

Changes the use placeholders in ::DBI _table_comment and _column_comment
methods to inline $dbh->quote protected values.

This is for DBD::Sybase with ASE versions that do not support
placeholders and MSSQL connections with a low tds version.

At some point we'll have methods for doing queries that do the right
thing depending on what the driver/database supports.

12 years agoupdate SQLAnywhere ODBC driver for default \"null"
Rafael Kitover [Wed, 19 Oct 2011 19:53:07 +0000]
update SQLAnywhere ODBC driver for default \"null"

Previously a fix was committed to support DEFAULT NULL in Pg, this
broke the SQLAnywhere ODBC driver tests, because ::DBI::SQLAnywhere had
a fixup for default_value => \"NULL", and it is now lowercased.

Only the ODBC driver sets nullable columns DEFAULT NULL, so this fixup
has been moved to ::DBI::ODBC::SQL_Anywhere, with the correct case.

All SQL Anywhere tests pass again.

12 years agoadd "use utf8;" at the top of all generated files
Rafael Kitover [Thu, 13 Oct 2011 17:04:52 +0000]
add "use utf8;" at the top of all generated files

In preparation for supporting Unicode identifiers in the future, this
commit adds "use utf8;" to the top of all generated files, before the
"package ...;" statement.

12 years agoadd POD for using non-English databases
Rafael Kitover [Thu, 13 Oct 2011 05:09:25 +0000]
add POD for using non-English databases

Adds POD describing the loader options to use to turn off inflection for
English.

12 years agouse full table name for MySQL key cache
Rafael Kitover [Wed, 12 Oct 2011 15:15:12 +0000]
use full table name for MySQL key cache

Primary/unique key cache now caches by $table->sql_name instead of
$table.

Failure to do so returned the wrong keys for the same table name in
multi-db_schema dumps.

12 years agomatch case of FK remote database in MySQL
Rafael Kitover [Wed, 12 Oct 2011 14:56:30 +0000]
match case of FK remote database in MySQL

Matches the remote database of a cross-database foreign key in MySQL to
the case of the database in SHOW DATABASES, if it's there and the user
has permissions to run SHOW DATABASES.

12 years agomake MySQL FK handling more robust
Rafael Kitover [Tue, 11 Oct 2011 17:33:22 +0000]
make MySQL FK handling more robust

Now handles FKs to schemas not listed in db_schema, and to tables that
don't exist at all.

12 years agominor fix for 5.8.1
Rafael Kitover [Wed, 10 Aug 2011 08:45:13 +0000]
minor fix for 5.8.1

sub {} returns the args it is passed on 5.8.1, so have to use
sub { return () } .

12 years agoremove dependency on File::Slurp
Rafael Kitover [Wed, 28 Sep 2011 19:31:02 +0000]
remove dependency on File::Slurp

The current version of File::Slurp has a "use 5.6.2;" statement. This
throws a warning on perl 5.10.0 which breaks some of our tests. The
statement should be "use 5.006002;".

My attempts to contact the author, Uri Guttman were not successful.

As we have our own convenience method 'slurp_file' in ::Utils now, there
is little need to depend on File::Slurp anymore anyway.

For these reasons the dependency has been removed.

12 years agoallow constraint/exclude options together
Brian Phillips [Wed, 28 Sep 2011 16:21:25 +0000]
allow constraint/exclude options together

12 years agofix t/backcompat/0.04006 tests
Rafael Kitover [Sat, 24 Sep 2011 19:28:04 +0000]
fix t/backcompat/0.04006 tests

The Oracle driver no longer lowercases table names from the catalog, and
these names are normalized to upper case. The main common tests alias
the lowercase table names for the monikers and classes hashes for this
case; this commit adds the same code to the t/backcompat/0.04006 common
tests (in lib/dbixcsl_common_tests.pm .)

12 years agofix preserve_case tests in common tests
Rafael Kitover [Sat, 24 Sep 2011 14:05:22 +0000]
fix preserve_case tests in common tests

Rescans with preserve_case option reset to the original value after
doing a rescan with preserve_case set to 1 and running the preserve_case
tests.

Failure to do so was breaking the Oracle extra tests.

12 years agoFix the failing pg tests (unicode wasn't slurped)
Peter Rabbitson [Wed, 7 Sep 2011 19:27:00 +0000]
Fix the failing pg tests (unicode wasn't slurped)

12 years agofix backcompat
Rafael Kitover [Wed, 7 Sep 2011 11:07:26 +0000]
fix backcompat

Fixes generating the old moniker when upgrading from a previous code
version (v4 unsingularized monikers -> singularized.)

t/25backcompat.t passes again.

12 years agofix uninit warn for no pod and result_base_class
Rafael Kitover [Tue, 6 Sep 2011 08:21:41 +0000]
fix uninit warn for no pod and result_base_class

12 years agofix multiple DEFAULT NULLs
Rafael Kitover [Tue, 6 Sep 2011 08:16:11 +0000]
fix multiple DEFAULT NULLs

    $info->{default_value} = \'null'

is unsafe because Data::Dump optimizes
refs to constants, so we must make sure to use:

    my $null = 'null';
    $info->{default_value} = \$null;

for all scalar refs in the dump.

12 years agofix defaults broken by last Pg defaults fix commit
Rafael Kitover [Tue, 6 Sep 2011 07:44:10 +0000]
fix defaults broken by last Pg defaults fix commit

12 years agoupdate Changes with Pg defaults fixes
Rafael Kitover [Tue, 6 Sep 2011 07:23:04 +0000]
update Changes with Pg defaults fixes

12 years agoimprove Pg default handling
Rafael Kitover [Tue, 6 Sep 2011 07:18:58 +0000]
improve Pg default handling

Correctly handles these cases:
 - <type> DEFAULT NULL
 - boolean DEFAULT 0::boolean

12 years agosort unique constraints
Rafael Kitover [Thu, 18 Aug 2011 20:55:09 +0000]
sort unique constraints

Relationships and unique constraints are now sorted by name in the
Result files to cut down on pointless diff spam in version control.

This commit also adds checking for the SCHEMA_LOADER_TESTS_NOCLEANUP
environment variable when removing the test sqlite DBs used by various
tests, this allows for inspecting them with the sqlite3 shell.

12 years agomulti db_schema support
Rafael Kitover [Mon, 30 May 2011 20:01:46 +0000]
multi db_schema support

Allows putting multiple schemas or databases and schemas into the
db_schema option. Supports cross-schema foreign keys where available. On
Sybase ASE, MSSQL and Informix multiple databases as well as schemas are
supported (but only Sybase ASE allows cross-database foreign keys.)

Adds the moniker_parts option for resolving name clashes when using
multiple schemas that have tables with the same name.

Table names are now represented by the ::Table class (all the code for
which is in the ::DBObject superclass.) There is also ::Table::Sybase
for Sybase ASE and MSSQL as well as ::Table::Informix for Informix. In
the future other database objects such as sequences may use the
::DBObject class.

Currently there are extra tests for objects in separate schemas and
cross-schema relationships for each database separately, these may later
be merged into the common tests in some fashion.

All database backends are up to date with respect to their capabilities
for fully qualified table names, with some exceptions.

 - no support for dblinks in Oracle
 - no support for serverlinks in MSSQL
 - no support for databases attached as namespaces in SQLite

For SQLite, Firebird and MS Access it is possible to pass a single
db_schema and have DBIC names qualified with it, but this capability is
primarily for testing and deployment.

12 years agosilence comment tests
Rafael Kitover [Wed, 10 Aug 2011 08:58:14 +0000]
silence comment tests

Adds quiet => 1 to loader_options for the comment tests to disable the
"Dumping manual schema..." warnings.

12 years agoupdate Changes with dbicdump config file support
Rafael Kitover [Wed, 10 Aug 2011 08:47:26 +0000]
update Changes with dbicdump config file support

12 years agoopt deps for dbicdump config and test
Rafael Kitover [Sun, 7 Aug 2011 12:57:12 +0000]
opt deps for dbicdump config and test

Adds Config::Any to dbicdump_config group in ::Optional::Dependencies
and Config::Any with Config::General to the test_dbicdump_config group.

Adds t/60dbicdump_config.t test for using a config file with dbicdump.

12 years agoconfig file support for dbicdump script
Al Newkirk [Tue, 26 Jul 2011 07:39:52 +0000]
config file support for dbicdump script

Changes dbicdump so that if only one parameter is given it is used as
the config file loaded with Config::Any. The config file must have the
keys schema_class and connect_info, and optionally loader_options.

12 years agopigs don't fly, they just roll around in shit
Rafael Kitover [Fri, 5 Aug 2011 08:44:15 +0000]
pigs don't fly, they just roll around in shit

Revert commit f1740f1b11e070f4e794fa43c606323d3ef528ab.

12 years agosome changes to filter code
Rafael Kitover [Fri, 5 Aug 2011 06:34:28 +0000]
some changes to filter code

Renames filter_generated_text => filter_generated_code.

Changes the filter coderef signature to take the type of file being
filtered, 'schema' or 'result'.

Adds support for setting the option to a string which is used as an
external filter program.

Updates Changes.

12 years agoadds the ability to filter generated code
Ben Tilly [Wed, 3 Aug 2011 23:24:25 +0000]
adds the ability to filter generated code

Adds the filter_generated_text option which takes a coderef for
filtering the generated code. The coderef takes the class and code as
parameters.

12 years agoflying pigs. almost as likely as win32 doing what you wanted it to.
Matt S Trout [Tue, 2 Aug 2011 13:05:43 +0000]
flying pigs. almost as likely as win32 doing what you wanted it to.

12 years agominor changes to table/column comment code
Rafael Kitover [Tue, 2 Aug 2011 10:07:38 +0000]
minor changes to table/column comment code

Updates Changes.

Mentions Oracle support in generate_pod POD in ::Loader::Base.

Adds checking for generic comments via ->next::method in ::DBI::Oracle
as well.

Wraps table/column comment queries for MySQL on information_schema in
try blocks, as not all versions of MySQL have information_schema (5.0+
 do.)

Changes MySQL comment tests to use the new slurp_file util.

Makes the test messages in t/30_*.t more clear.