获取错误DBI_DRIVER在运行dbicdump时未设置env var

时间:2017-09-22 13:06:41

标签: sqlite perl dbix-class dbd

我正在测试将DBIx::Class转储到Windows 7计算机上的示例sqlite数据库。 我已经安装了DBIx::Class::Schema::Loader以及DBIDBD::SQLite模块,但是当我使用脚本dbicdump时,它会出现以下错误

C:\Users\Foo\Documents\dbDump>perl dbicdump.pl dump_directory=.\lib ^
More?     -o components="[q{InflateColumn::DateTime}]" ^
More?     -o preserve_case=1 ^
More?     MyApp::Schema DBI::SQLite:./sqlite.db

DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: Can't   connect
to data source 'MyApp::Schema' because I can't work out what driver to use (it 
doesn't seem to contain a 'dbi:driver:' prefix and the DBI_DRIVER env var is not
set) at C:/Perl64/site/lib/DBIx/Class/Storage/DBI.pm line 1517. at dbicdump.pl 
line 178

我尝试使用Google搜索,但无法找到解决此问题的任何内容。

1 个答案:

答案 0 :(得分:2)

在解析命令行选项时,dbicdump看起来有点混乱。它认为MyApp::Schema是连接信息,而不是DBI::SQLite:./sqlite.db

我怀疑是因为你错过了应该在-o选项之前的dump_directory=.\lib