prostgles-client
TypeScript icon, indicating that this package has built-in type declarations

4.0.115 • Public • Published

prostgles-client

Isomorphic TypeScript client for PostgreSQL

GitHub license npm version Dependency Status Known Vulnerabilities Tests

Installation

Module

$ npm install prostgles-client socket.io-client

CDN

<head>
    <script src="https://unpkg.com/socket.io-client@3.0.3/dist/socket.io.min.js" type="text/javascript"></script>
    <script src="https://unpkg.com/prostgles-client@latest/dist/index.js" type="text/javascript"></script>	
</head>

Usage

Vanilla js

prostgles({
  socket: io(), 
  onReady: async (db) => {
    const latest_posts = await db.posts.find({ }, { orderBy: { created: -1 } });
  }
});

React hooks

const latest_posts = dbo.posts.useFind({ }, { orderBy: { created: -1 } });
const user = dbo.users.useSubscribeOne({ id: 1 });

Examples

License

MIT

Package Sidebar

Install

npm i prostgles-client

Weekly Downloads

317

Version

4.0.115

License

MIT

Unpacked Size

482 kB

Total Files

57

Last publish

Collaborators

  • prostgles