---
title: "Discussion on \"How to Build a Server with Hanami::API and Postgres\" | Hashnode"
description: "Discussion on \"How to Build a Server with Hanami::API and Postgres\". DISCLAIMER: This is a basic article about Hanami::API, showing how to perform CRUD operations using Postgres through PG driver. I'm writing this article to continue learning about Ruby so probably my code is not idiomatic.\nHanami-API is a lightweight..."
url: "https://hashnode.com/posts/how-to-build-a-server-with-hanamiapi-and-postgres/646407d16ea7ff5aa7e1588a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Build a Server with Hanami::API and Postgres](https://carlosmv.hashnode.dev/how-to-build-a-server-with-hanamiapi-and-postgres?utm_source=hashnode&utm_medium=feed)

DISCLAIMER: This is a basic article about Hanami::API, showing how to perform CRUD operations using Postgres through PG driver. I'm writing this article to continue learning about Ruby so probably my code is not idiomatic. Hanami-API is a lightweight...

May 16, 2023 · 11 min read · carlosmv.hashnode.dev  
Updated May 22, 2023  
Read the article

-   [#ruby](https://hashnode.com/tag/ruby)
-   [#hanami](https://hashnode.com/tag/hanami)
-   [#postgresql](https://hashnode.com/tag/postgresql)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Carlos Armando Marcano Vargas](https://hashnode.com/@Carlos27)

@Carlos27 · Maturín, Venezuela

  
[View profile](https://hashnode.com/@Carlos27)

Backend developer

I am a backend developer from Venezuela. I enjoy writing tutorials for open source projects I using and find interesting. Mostly I write tutorials about Python, Go, and Rust.

## Responses 1

Markdown supported · ⌘↵ to post

[Júnior Beto](https://hashnode.com/@juniorB)

[Jun 29, 2023](https://hashnode.com/posts/how-to-build-a-server-with-hanamiapi-and-postgres/646407d16ea7ff5aa7e1588a/comment/649dba7b2a0936ab01ee0b43)

What if you wanted different databases to each environment so you can test your application?

kinda like rails do.

[Carlos Armando Marcano Vargas](https://hashnode.com/@Carlos27)

[Jul 1, 2023](https://hashnode.com/posts/how-to-build-a-server-with-hanamiapi-and-postgres/646407d16ea7ff5aa7e1588a/comment/649dba7b2a0936ab01ee0b43#reply-64a0b0238db091c401034329)

Hey, Júnior, I hope you are very well. I didn't know you can do that with Rails. I'm very new in this ecosystem and in Ruby in general. But I don't know how to add different databases to each environment. Maybe you can find the answer asking here: [github.com/hanami/hanami/issues.](https://github.com/hanami/hanami/issues.) Or in its discourse site: [discourse.hanamirb.org](https://discourse.hanamirb.org/) Or in its subreddit: [reddit.com/r/hanamirb](https://www.reddit.com/r/hanamirb/)

Sorry, I can help you with your question. Thank you for your question.

Have a nice day.

[Júnior Beto](https://hashnode.com/@juniorB)

[Jul 3, 2023](https://hashnode.com/posts/how-to-build-a-server-with-hanamiapi-and-postgres/646407d16ea7ff5aa7e1588a/comment/649dba7b2a0936ab01ee0b43#reply-64a2c253fda312e2adb062a5)

thanks for the answer, have a nice day you too!! [Carlos Armando Marcano Vargas](https://hashnode.com/@Carlos27)
