{"id":18840419,"url":"https://github.com/mojolicious/mojo-pg","last_synced_at":"2025-12-18T12:17:31.815Z","repository":{"id":21428882,"uuid":"24747044","full_name":"mojolicious/mojo-pg","owner":"mojolicious","description":"Mojolicious :heart: PostgreSQL","archived":false,"fork":false,"pushed_at":"2022-03-23T17:08:34.000Z","size":796,"stargazers_count":99,"open_issues_count":4,"forks_count":46,"subscribers_count":32,"default_branch":"main","last_synced_at":"2024-12-09T19:53:40.447Z","etag":null,"topics":["mojolicious","perl","postgresql"],"latest_commit_sha":null,"homepage":"https://metacpan.org/release/Mojo-Pg","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mojolicious.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-03T04:43:40.000Z","updated_at":"2024-09-11T08:18:54.000Z","dependencies_parsed_at":"2022-07-27T02:32:08.000Z","dependency_job_id":null,"html_url":"https://github.com/mojolicious/mojo-pg","commit_stats":null,"previous_names":[],"tags_count":99,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojolicious%2Fmojo-pg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojolicious%2Fmojo-pg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojolicious%2Fmojo-pg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojolicious%2Fmojo-pg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mojolicious","download_url":"https://codeload.github.com/mojolicious/mojo-pg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230388131,"owners_count":18217755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mojolicious","perl","postgresql"],"created_at":"2024-11-08T02:47:35.893Z","updated_at":"2025-12-18T12:17:26.752Z","avatar_url":"https://github.com/mojolicious.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Mojo::Pg [![](https://github.com/mojolicious/mojo-pg/workflows/linux/badge.svg)](https://github.com/mojolicious/mojo-pg/actions)\n\n  A tiny wrapper around [DBD::Pg](https://metacpan.org/pod/DBD::Pg) that makes [PostgreSQL](https://www.postgresql.org)\n  a lot of fun to use with the [Mojolicious](https://mojolicious.org) real-time web framework.\n\n```perl\nuse Mojolicious::Lite -signatures;\nuse Mojo::Pg;\n\nhelper pg =\u003e sub { state $pg = Mojo::Pg-\u003enew('postgresql://postgres@/test') };\n\n# Use migrations to create a table during startup\napp-\u003epg-\u003emigrations-\u003efrom_data-\u003emigrate;\n\nget '/' =\u003e sub ($c) {\n\n  my $db = $c-\u003epg-\u003edb;\n  my $ip = $c-\u003etx-\u003eremote_address;\n\n  # Store information about current visitor blocking\n  $db-\u003equery('INSERT INTO visitors VALUES (NOW(), ?)', $ip);\n\n  # Retrieve information about previous visitors non-blocking\n  $db-\u003equery('SELECT * FROM visitors LIMIT 50' =\u003e sub ($db, $err, $results) {\n\n    return $c-\u003ereply-\u003eexception($err) if $err;\n\n    $c-\u003erender(json =\u003e $results-\u003ehashes-\u003eto_array);\n  });\n};\n\napp-\u003estart;\n__DATA__\n\n@@ migrations\n-- 1 up\nCREATE TABLE visitors (at TIMESTAMP WITH TIME ZONE, ip TEXT);\n-- 1 down\nDROP TABLE visitors;\n```\n\n## Installation\n\n  All you need is a one-liner, it takes less than a minute.\n\n    $ curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n Mojo::Pg\n\n  We recommend the use of a [Perlbrew](http://perlbrew.pl) environment.\n\n## Want to know more?\n\n  Take a look at our excellent\n  [documentation](https://mojolicious.org/perldoc/Mojo/Pg)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmojolicious%2Fmojo-pg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmojolicious%2Fmojo-pg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmojolicious%2Fmojo-pg/lists"}