prostgles-client
v4.0.138
Published
Reactive client for Postgres
Downloads
293
Maintainers
Readme
prostgles-client
Isomorphic TypeScript client for PostgreSQL
Installation
Module
$ npm install prostgles-client socket.io-client
CDN
<head>
<script src="https://unpkg.com/[email protected]/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 });