Code Monkey home page Code Monkey logo

Comments (3)

mvp-joe avatar mvp-joe commented on May 22, 2024

I like this idea a lot. It would be super helpful to be able to use third-party go SQL ORMs & mappers - honestly one of the biggest pain points with encore right now.

Thanks for the proposal @eandre!

from encore.

windwp avatar windwp commented on May 22, 2024

@eandre
hi is there any example of how to you encore with gorm.
sorry, i am new to golang I am comming from nodejs .just learn go a bit.
I need a way to get connect string from encore then I can use gorm.
Thank

from encore.

eandre avatar eandre commented on May 22, 2024

Hey @windwp, we should add some documentation on how to do this, but I suspect something like this should work:

import (
    "gorm.io/driver/postgres"
    "gorm.io/gorm"
    "encore.dev/storage/sqldb"
)

dialect := postgres.New(postgres.Config{
    Conn: sqldb.Named("mydb").Stdlib(),
})
db, err := gorm.Open(dialect, &gorm.Config{})

Let me know if you run into any issues!

from encore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.