[jifty-devel] Tutorial questions

Rob Kinyon rob.kinyon at gmail.com
Wed Jan 4 11:04:47 EST 2006


First off, this looks very very cool. It's the closest to Rails I've
seen in Perl, which is impressive.

I'm just starting to run through the tutorial now and I've run into
the following items:

1) If you run the following commands, you hit an error (No
inc::Module::Install found)
  jifty app --name MyWebLog
  cd MyWebLog
  perl Makefile.PL
Having remedied that by copying the inc found in SVN, I am now able to
run "make test" with the base Post model and I'm happy.

2) I don't like SQLite. So, I want to use MySQL. The tutorial says if
I want to do that, I need to look in Jifty::Config. Except,
Jifty::Config doesn't tell me anything about what to set. So, I look
in Jifty::DBI and Jifty::DBI::mysql, but they don't talk about config
files. So, I hop into etc/config.yml and it looks pretty simple. So, I
change the user/pw to something my db has and the schema to "test". I
run "make test" and hit the following:

"Connect Failed Access denied for user 'rob'@'localhost' to database
'testtest' at /usr/lib/perl5/site_perl/5.8.6/i486-linux/Jifty/Script/Schema.pm
line 409"

That's cool, except I put "test", not "testtest". So, there seem to be
different schemas based on whether you're doing dev vs. testing, like
in Rails. Where is this documented?

3) I fix the schema name issue and run "make test" again. This time, I
hit the following:

error creating a table: Couldn't execute the query 'CREATE TABLE posts (
  id INTEGER NOT NULL  AUTO_INCREMENT,
  body text NULL  ,
  title text NULL DEFAULT 'Untitled post' ,
  PRIMARY KEY (id)
)
'BLOB/TEXT column 'title' can't have a default value at
/usr/lib/perl5/site_perl/5.8.6/i486-linux/Jifty/Script/Schema.pm line
224.

That's not a MySQL idiosyncracy, that's a SQLite idiosyncracy.

4) I change the columntype for title to "varchar". Now, it complains
about the syntax:

error creating a table: Couldn't execute the query 'CREATE TABLE posts (
  id INTEGER NOT NULL  AUTO_INCREMENT,
  body text NULL  ,
  title varchar NULL DEFAULT 'Untitled post' ,
  PRIMARY KEY (id)
)
'You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'NULL DEFAULT 'Untitled post' ,

I fix this by changing varchar => varchar(255) and the tests pass. I
would've thought that Jifty::DBI::mysql would be smart enough to fix
this problem.

5) Whenever I ran "make test", the weblogtest database would
disappear! This means I cannot run "make test" twice in a row. Why
does it disappear?!? This is a serious usability issue.

6) Why can't I use Module::Build instead of Module::Install? For one
thing, adding in new actions is very simple. Take a look at
Module::Build::JSAN for an example. Some actions I can see being handy
would be "create_databases", "load_fixtures", etc. A
Module::Build::Jifty would definitely be in order.

7) Something I noticed when sourcediving - "use warnings" is all over
the place. Yet, I didn't see a restriction on Perl version 5.6+
anywhere in the install process. If it's 5.6+, that's cool. Just make
sure that it's restricted to that in the install process. Also, if you
have "use warnings", you don't need "-w" in the tests. Also, I noticed
that Jifty::DBI::Column doesn't have strictures or warnings enabled. I
would recommend that the specific stricture be disabled in a tight
section vs. disabling all strictures for the file.

More thoughts later.

Rob


More information about the jifty-devel mailing list