Description
I have been having a close look at deno and have had an attempt to build a solution with it. It is delightfully refreshing to not have to build a project, and to be able to use the current JavaScript language features.
At this point in time, there are limited options for working with PostgreSQL.
The main project on the Third Party Modules list, deno-postgres, has one major feature missing and one show stopper bug. I considered trying to contribute to the project however after having a look at what has been done with this project, there are huge amounts of work required.
I looked for an issue being raised here about porting over to Deno
and there was none so I'm bringing up the discussion.
I am no expert on Deno
although I did migrate a couple of projects over to it already being pg-format and cuid.
As far as I am aware, to migrate this project so that it will work on Deno
would require the following:
- Replace
require
withimport
- Replace
module.exports
withexport
- Migrate the Node.js Buffer over to Deno.Buffer
- Migrate other
Node.js
APIs toDeno
or JS and Web standard APIs (EventEmitter to EventTarget as an example) - Migrate the tests from
lerna
to the built-in Deno.test runner and standard library assertions.
I imagine the mix of js
and ts
modules would be an issue. I'm not a TypeScript guy. There are probably a few other issues which will arise as you would expect.
The deno-postgres project has been created by one of the main Deno
developers, Bartek Iwańczuk, and he has stated that he is busy with the core of Deno
at the moment. He is going to work on it soon. It is not a fork of this project though and is missing many features at this time.
When you consider the vast amount of work that has been put into this project, it seems a shame to re-invent the wheel. Both Node.js
and Deno
run JavaScript. That being said, Deno
tries as much as possible to stick to the Web Standard APIs. This will mean significant changes and therefore it is unlikely to be able to keep the Node.js
and Deno
port in sync.
I'm just opening the discussion here to gauge interest.