$sth->execute();
while ( my $info = $sth->fetchrow_hashref() ){
my %column_info;
- $column_info{data_type} = $info->{TYPE_NAME};
- $column_info{size} = $info->{COLUMN_SIZE};
- $column_info{is_nullable} = $info->{NULLABLE} ? 1 : 0;
+ $column_info{data_type} = $info->{TYPE_NAME};
+ $column_info{size} = $info->{COLUMN_SIZE};
+ $column_info{is_nullable} = $info->{NULLABLE} ? 1 : 0;
$column_info{default_value} = $info->{COLUMN_DEF};
+
$result{$info->{COLUMN_NAME}} = \%column_info;
}
};
$column_info{data_type} = $type_name ? $type_name : $type_num;
$column_info{size} = $sth->{PRECISION}->[$i];
$column_info{is_nullable} = $sth->{NULLABLE}->[$i] ? 1 : 0;
+
+ if ($column_info{data_type} =~ m/^(.*?)\((.*?)\)$/) {
+ $column_info{data_type} = $1;
+ $column_info{size} = $2;
+ }
+
$result{$columns[$i]} = \%column_info;
}
--
-- Created by SQL::Translator::Producer::SQLite
--- Created on Fri Feb 24 15:13:57 2006
+-- Created on Sun Mar 19 19:16:50 2006
--
BEGIN TRANSACTION;
--
+-- Table: serialized
+--
+CREATE TABLE serialized (
+ id INTEGER PRIMARY KEY NOT NULL,
+ serialized text NOT NULL
+);
+
+--
-- Table: twokeys
--
CREATE TABLE twokeys (
);
--
+-- Table: liner_notes
+--
+CREATE TABLE liner_notes (
+ liner_id INTEGER PRIMARY KEY NOT NULL,
+ notes varchar(100) NOT NULL
+);
+
+--
-- Table: cd_to_producer
--
CREATE TABLE cd_to_producer (
);
--
--- Table: liner_notes
---
-CREATE TABLE liner_notes (
- liner_id INTEGER PRIMARY KEY NOT NULL,
- notes varchar NOT NULL
-);
-
---
-- Table: artist
--
CREATE TABLE artist (
artistid INTEGER PRIMARY KEY NOT NULL,
- name varchar
+ name varchar(100)
);
--
CREATE TABLE cd (
cdid INTEGER PRIMARY KEY NOT NULL,
artist integer NOT NULL,
- title varchar NOT NULL,
- year varchar NOT NULL
+ title varchar(100) NOT NULL,
+ year varchar(100) NOT NULL
);
--
trackid INTEGER PRIMARY KEY NOT NULL,
cd integer NOT NULL,
position integer NOT NULL,
- title varchar NOT NULL
+ title varchar(100) NOT NULL
);
--
--
CREATE TABLE producer (
producerid INTEGER PRIMARY KEY NOT NULL,
- name varchar NOT NULL
-);
-
---
--- Table: treelike
---
-CREATE TABLE treelike (
- id INTEGER PRIMARY KEY NOT NULL,
- parent integer NOT NULL,
- name varchar NOT NULL
+ name varchar(100) NOT NULL
);
--
CREATE TABLE tags (
tagid INTEGER PRIMARY KEY NOT NULL,
cd integer NOT NULL,
- tag varchar NOT NULL
+ tag varchar(100) NOT NULL
);
--
--
CREATE TABLE self_ref (
id INTEGER PRIMARY KEY NOT NULL,
- name varchar NOT NULL
+ name varchar(100) NOT NULL
);
--
--- Table: serialized
+-- Table: treelike
--
-CREATE TABLE serialized (
- id INTEGER PRIMARY KEY NOT NULL,
- serialized text NOT NULL
+CREATE TABLE treelike (
+ id INTEGER PRIMARY KEY NOT NULL,
+ parent integer NOT NULL,
+ name varchar(100) NOT NULL
);
COMMIT;