All Projects → mojolicious → Mojo Pg

mojolicious / Mojo Pg

Licence: artistic-2.0
Mojolicious ❤️ PostgreSQL

Programming Languages

perl
6916 projects

Projects that are alternatives of or similar to Mojo Pg

Pg Anonymizer
Dump anonymized PostgreSQL database with a NodeJS CLI
Stars: ✭ 83 (-9.78%)
Mutual labels:  postgresql
Testgres
Testing framework for PostgreSQL and its extensions
Stars: ✭ 85 (-7.61%)
Mutual labels:  postgresql
Memento
Collect saved items from different sources around the web
Stars: ✭ 89 (-3.26%)
Mutual labels:  postgresql
Chloe
A lightweight and high-performance Object/Relational Mapping(ORM) library for .NET --C#
Stars: ✭ 1,248 (+1256.52%)
Mutual labels:  postgresql
Xeus Sql
xeus-sql is a Jupyter kernel for general SQL implementations.
Stars: ✭ 85 (-7.61%)
Mutual labels:  postgresql
Pgbouncer
lightweight connection pooler for PostgreSQL
Stars: ✭ 1,263 (+1272.83%)
Mutual labels:  postgresql
Pg activity
pg_activity is a top like application for PostgreSQL server activity monitoring.
Stars: ✭ 1,232 (+1239.13%)
Mutual labels:  postgresql
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite & MongoDB (Preview)
Stars: ✭ 18,168 (+19647.83%)
Mutual labels:  postgresql
Gonymizer
Gonymizer: A Tool to Anonymize Sensitive PostgreSQL Data Tables for Use in QA and Testing
Stars: ✭ 85 (-7.61%)
Mutual labels:  postgresql
Udacity Data Engineering
Udacity Data Engineering Nano Degree (DEND)
Stars: ✭ 89 (-3.26%)
Mutual labels:  postgresql
Twist V2
A book review tool for Leanpub's Markdown Book Format
Stars: ✭ 82 (-10.87%)
Mutual labels:  postgresql
Gopherus
This tool generates gopher link for exploiting SSRF and gaining RCE in various servers
Stars: ✭ 1,258 (+1267.39%)
Mutual labels:  postgresql
Electrocrud
Database CRUD Application Built on Electron | MySQL, Postgres, SQLite
Stars: ✭ 1,267 (+1277.17%)
Mutual labels:  postgresql
Open Bank Mark
A bank simulation application using mainly Clojure, which can be used to end-to-end test and show some graphs.
Stars: ✭ 81 (-11.96%)
Mutual labels:  postgresql
Stolon Chart
Kubernetes Helm chart to deploy HA Postgresql cluster based on Stolon
Stars: ✭ 90 (-2.17%)
Mutual labels:  postgresql
Bug Tracker Pern Ts
Bug Tracking app with project members support. Made with PERN stack + TypeScript.
Stars: ✭ 79 (-14.13%)
Mutual labels:  postgresql
Graphjin
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
Stars: ✭ 1,264 (+1273.91%)
Mutual labels:  postgresql
Entityworker.core
EntityWorker is an object-relation mapper(ORM) that enable .NET developers to work with relations data using objects. EntityWorker is an alternative to entityframwork. is more flexible and much faster than entity framework.
Stars: ✭ 91 (-1.09%)
Mutual labels:  postgresql
Postgresql Action
GitHub Action to setup a PostgreSQL database
Stars: ✭ 91 (-1.09%)
Mutual labels:  postgresql
Hasql Th
Template Haskell utilities for Hasql
Stars: ✭ 87 (-5.43%)
Mutual labels:  postgresql

Mojo::Pg

A tiny wrapper around DBD::Pg that makes PostgreSQL a lot of fun to use with the Mojolicious real-time web framework.

use Mojolicious::Lite -signatures;
use Mojo::Pg;

helper pg => sub { state $pg = Mojo::Pg->new('postgresql://[email protected]/test') };

# Use migrations to create a table during startup
app->pg->migrations->from_data->migrate;

get '/' => sub ($c) {

  my $db = $c->pg->db;
  my $ip = $c->tx->remote_address;

  # Store information about current visitor blocking
  $db->query('INSERT INTO visitors VALUES (NOW(), ?)', $ip);

  # Retrieve information about previous visitors non-blocking
  $db->query('SELECT * FROM visitors LIMIT 50' => sub ($db, $err, $results) {

    return $c->reply->exception($err) if $err;

    $c->render(json => $results->hashes->to_array);
  });
};

app->start;
__DATA__

@@ migrations
-- 1 up
CREATE TABLE visitors (at TIMESTAMP WITH TIME ZONE, ip TEXT);
-- 1 down
DROP TABLE visitors;

Installation

All you need is a one-liner, it takes less than a minute.

$ curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n Mojo::Pg

We recommend the use of a Perlbrew environment.

Want to know more?

Take a look at our excellent documentation!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].