Skip Menu |

This queue is for tickets about the DBIx-Class-Schema-Loader CPAN distribution.

Report information
The Basics
Id: 54538
Status: resolved
Priority: 0/
Queue: DBIx-Class-Schema-Loader

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.05001
Fixed in: (no value)



Subject: SQLite schema scanner using the wrong quote
Hi, Schema::Loader failed to handle a SQLite schema of mine which was using excessive quoting of identifiers (it was generated). For example. CREATE TABLE "foo" ( "thing" INTEGER PRIMARY KEY ); The problem is the regex its using to strip off "CREATE TABLE foo" is looking for words, spaces or SINGLE quotes. SQL identifiers are quoted with double quotes. Here's a patch. Sorry there's no test, the Schema::Loader tests are a bit opaque. --- a/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm @@ -62,7 +62,7 @@ sub _sqlite_parse_table { $sth->finish; # Cut "CREATE TABLE ( )" blabla... - $sql =~ /^[\w\s']+\((.*)\)$/si; + $sql =~ /^[\w\s"]+\((.*)\)$/si; my $cols = $1; # strip single-line comments
Fixed in git, thank you very much for the patch, will release 0.05002 a bit later today.