Isomorphic TypeScript client for PostgreSQL
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>
prostgles({
socket: io(),
onReady: async (db) => {
const latest_posts = await db.posts.find({ }, { orderBy: { created: -1 } });
}
});
const latest_posts = dbo.posts.useFind({ }, { orderBy: { created: -1 } });
const user = dbo.users.useSubscribeOne({ id: 1 });