2022-07-13
3198
#deno#postgresql
Diogo Souza
15453
Jul 13, 2022 ⋅ 11 min read

How to create a REST API with Deno and Postgres

Diogo Souza Brazilian dev. Creator of altaluna.com.br

Recent posts:

Comparing Mutative Vs Immer Vs Reducers For Data Handling In React

Comparing React state tools: Mutative vs. Immer vs. reducers

Mutative processes data with better performance than both Immer and native reducers. Let’s compare these data handling options in React.

Rashedul Alam
Apr 26, 2024 ⋅ 7 min read
Radix Ui Adoption Guide Overview Examples And Alternatives

Radix UI adoption guide: Overview, examples, and alternatives

Radix UI is quickly rising in popularity and has become an excellent go-to solution for building modern design systems and websites.

Nefe Emadamerho-Atori
Apr 25, 2024 ⋅ 11 min read
Understanding The Css Revert Layer Keyword, Part Of Css Cascade Layers

Understanding the CSS revert-layer keyword

In this article, we’ll explore CSS cascade layers — and, specifically, the revert-layer keyword — to help you refine your styling strategy.

Chimezie Innocent
Apr 24, 2024 ⋅ 6 min read
Exploring Nushell, A Rust Powered, Cross Platform Shell

Exploring Nushell, a Rust-powered, cross-platform shell

Nushell is a modern, performant, extensible shell built with Rust. Explore its pros, cons, and how to install and get started with it.

Oduah Chigozie
Apr 23, 2024 ⋅ 6 min read
View all posts

11 Replies to "How to create a REST API with Deno and Postgres"

  1. > In order to prevent SQL injection — like every other major database framework — Deno allows us to pass parameters to our SQL queries as well.

    Am I missing something or is the `beerRepo.update()` function *full* of SQL injections? Example:

    query += ` SET name = ‘${beer.name}’` …

  2. deno run –allow-net –allow-env index.js
    error: No such file or directory (os error 2)

    I got this error, when i am trying run

  3. Compile file:///home/zire/dcode/postgr/index.js
    error: Uncaught AssertionError: Unexpected skip of the emit.
    at Object.assert ($deno$/util.ts:33:11)
    at compile ($deno$/compiler.ts:1170:7)
    at tsCompilerOnMessage ($deno$/compiler.ts:1338:22)
    at workerMessageRecvCallback ($deno$/runtime_worker.ts:72:33)
    at file:///home/zire/dcode/postgr/__anonymous__:1:1

  4. Hi guys, thanks very much for the comments. I’ve already addressed all of them both in the article and in the GitHub repo.

    Please, let me know if there’s still any problems to you. 🙂

  5. Great tutorial thanks! Hey would love to see a Typescript version of this project, anyone have an example of PostgreSQL + Deno + Typescript?

  6. Hey folks, I’ve had a go at converting this project to Typescript. Made some minor improvements/changes along the way. Classes seem to cause problems when instantiating the database, “possible undefined value” errors, so I removed them as they aren’t really needed.
    For any of you who are Typescript Savvy, I would love to get some feedback if I’ve gone about this the right way?
    https://github.com/fredlemieux/deno-postgresql-example

Leave a Reply