Since people here probably don't read Eastern European languages it might
be more useful to dump your schema from your database so we can see it.

You also need more code to put some context around what you are doing. I'm
struggling to work it out as its fragments. I'm not going to help much on
the Mojolicious side but we have a big implementation with Perl and SQLite.

Your error looks straightforward, there is no table 'posts' for the
prepared statement, also looking at the create table statement in the link,
theres also no columns called tags or title. A look at the schema would
confirm or deny this.

Rob

On Thu, May 21, 2015 at 10:13 AM, Marlik <[email protected]> wrote:

> Hello, I receive an error. I am doing so...
>
>
> example dump here - 
> http://pragmaticperl.com/issues/06/pragmaticperl-06-dbixclass-%D0%B2-%D0%BF%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D0%B0%D1%85.html
>
> sqlite3 blog.db < blog.sql
>
> dbicdump -o dump_directory=./lib -o
> components='["InflateColumn::DateTime"]' Schema dbi:SQLite:./dump/blog.db
>
> in MyApp:
>
> use Schema;
>
> has schema => sub {
>   return Schema->connect('dbi:SQLite:' . ($ENV{BLOG_DB} ||
> './dump/blog.db'));
> };
>
> in startup:
>
> $self->helper(db => sub { $self->app->schema });
>
> in controller:
>
> my $self = shift;
>
>     my ($title, $body, $tags) = @{$self->req->params->to_hash}{ 'title',
> 'body', 'tags' };
>
>     my $result = $self->db->resultset('Post')->create({
>     title => '$title',
>     post  => '$body',
>     tags => '$tags'
>     });
>
> I receive an error:
>
> DBIx::Class::Storage::DBI::_prepare_sth(): DBI Exception: DBD::SQLite::db 
> prepare_cached failed: no such table: posts [for Statement "INSERT INTO posts 
> ( post, tags, title) VALUES ( ?, ?, ? )"
>
>
>
> What am i doing wrong? Thanks.
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to