@ Brad Gilbert is right. Statements allow only 5 kinds of data structures, and none of them is Date . TIME and Date are standard data types in SQL , but so far they do not seem to support DBIish. In this case, you can simply change line 85 to
$test.insert("Cheese", 2, 1.99, 'Block of cheddar', Date.new(now).Str);
and while your program handles the conversion to and from dates, you also have to change the definition of the Essential table. You can also allow the database to handle default values. You will have to eliminate “non null” because this contradicts the default clause.
There are also a number of minor errors. This, minimized expression, works and correctly inserts the default timestamp into the database (as indicated by the sqlite3 command line):
use v6; use DBIish; constant DB = 'budgetpro.sqlite3'; my $dbh = DBIish.connect('SQLite', database => DB);
Note that your Item class is not actually created by running the insert clause, and therefore the $test.name on the last line simply returns an empty object with the default values assigned to the instance variables. You might want to change the insert method to a submethod that instantiates an element and inserts it into the database.
source share