use v5.22.0; use Mojo::Pg; my $pg = Mojo::Pg->new('postgresql://postgres:fengguang@localhost/postgres'); my $result = $pg->migrations->from_file('E:\QMDownload\Mojo-Pg-2.08\examples\blog\migrations\blog.sql')->migrate; say $pg->db->query('select ?::json as foo', {json => {bar => 'baz'}}) ->expand->hash->{foo}{bar}; #### -- 1 up create table if not exists posts ( id serial primary key, title text, body text ); -- 1 down drop table if exists posts;