home.social

#gorm — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #gorm, aggregated by home.social.

fetched live
  1. Learn to build a functional web API with Go 1.26, covering RESTful endpoints, database persistence with PostgreSQL and GORM, and testing best practices in under an hour.

    #Go programming #Web API #RESTful API #PostgreSQL #GORM

    dasroot.net/posts/2026/02/buil

  2. A question for the #Golang crowd! I'm building an API for configuring e-mail hosting. I want a simple #REST #API, and I'd like to build a #kubectl like command line client too. Backend will probably be #GORM and #PostgreSQL with a lot of different entities. What would you recommend for keeping the server and client models in sync? I'm thinking some sort of code generation, but I'm unsure about the direction to go in - #OAPI #Codegen or #Swaggo? Annotations in code or a definition in Yaml? Perhaps with the generated models in a separate module for easy sharing between #client and #server? How do the clever people do it? :-)

    #go

  3. Today we learn that gorm’s many2many association is (technically) broken if you use it with the embedded gorm.Model because that creates an artificial id sequence primary key field that obviously doesn’t conflict when you have multiple of the same, e.g., role but setting index:,unique on the field you need to be unique causes insert errors (at least using sqlite.)

    (Not hugely traumatic because I don’t need a sequence id anyway, I just wanted the metadata fields in gorm.Model which can just be copied into my own meta-model.)

    This post brought to you by 80 minutes of confusion and England being suprisingly not rubbish at cricket.

    #Go #Gorm #SQLite

  4. Психанул на неудобный драйвер pgx и написал свою библиотеку. Все как по канонам гошников ) — Golang

    После месяцев рутинного сканирования строк в структуры я решил: "Хватит это терпеть!" и психанув, создал обертку, которая: ✔ Автоматизирует скан — никаких rows.Scan(), просто передаете структуру ✔ Работает с любыми вложенностями — даже сложные JSON-поля парсятся без боли ✔ Не тормозит — минимальные накладные расходы, вся мощь pgx сохраняется ✔ Подходит для любого проекта — можно внедрять постепенно 👉 Это не просто библиотека — это мой ответ на боль всех gopher'ов!

    habr.com/ru/articles/931248/

    #go #golang #orm #postgres #postgresql #pgx #gorm #opensource #software #sql

  5. pgxWrappy — потому что жизнь слишком коротка для ручного сканирования в Go! �

    Если вы устали от бесконечного rows.Scan(), ручного разбора вложенных структур и километрового boilerplate-кода — pgxWrappy создан для вас! 🚀 Делаем неудобное удобным! Жить с удобством

    habr.com/ru/articles/931242/

    #Go #golang #pgx #sql #gorm #orm #postgres #pgsql #database #opensource

  6. Как построить оценку качества контакт-центра с помощью Speech Analytics API

    Привет, Хабр! Контакт-центры — это важная линия взаимодействия бизнеса с клиентами. Клиенты могут быть разными: кто-то жалуется на задержки, кто-то хочет вернуть товар, а кто-то просто звонит выразить благодарность. Но для бизнеса важно понять одно: насколько хорошо оператор решил проблему клиента? И ушел ли клиент довольным? В этой статье создадим систему для анализа качества работы операторов. Будем извлекать данные о звонках, сохранять их в базе данных и автоматизируем процесс с помощью webhook. В конце концов, контакт-центр — это не только про разговоры, это про цифры.

    habr.com/ru/companies/exolve/a

    #kpi_колцентра #оценка_качества #Speech_Analytics_API #sqlite #gorm #webhook #контактцентр #анализ_звонков

  7. Version 0.2.11 of my Mishos TV tracking app has been released.

    Another small update. I redesigned the main menu to be collapsable with text descriptions. I also redesigned the top header menus a bit.

    github.com/bljohnsondev/mishos

    #mishos #webdev #selfhosted #selfhosting #foss #html #css #javascript #lit #webcomponents #golang #gin #gorm

  8. Как подружить Gorm и PostGIS, решение промышленного уровня

    GORM Фантастическая ORM для Golang. PostGIS расширяет возможности реляционной базы данных PostgreSQL , добавляя поддержку хранения, индексирования и запросов геопространственных данных. В этой статье поделимся своим опытом интеграции GORM и PostGIS, сложностями при попытке использования gorm для работы с геометрическими данными и конечно предлагаем готовое решение. Изначально эта статья была опубликована здесь .

    habr.com/ru/articles/847048/

    #geolocation #golang #gorm #postgis #postgres #геоданные

  9. Version 0.2.10 of my Mishos TV tracking app has been released.

    This is a small update. Someone added a good issue asking if there is a way to test the notification URL. Now there is! I added a "Send Test" button that will trigger a notification test.

    github.com/bljohnsondev/mishos

    #mishos #webdev #selfhosted #selfhosting #foss #html #css #javascript #lit #webcomponents #golang #gin #gorm

  10. Version 0.2.9 of my Mishos TV tracking app has been released.

    I found an issue where TVMaze added incorrect episodes to a show and then removed them but the local show refresh process didn't pick up the removed episodes.

    - Fixed an issue when refreshing show data if the provider removed episodes.

    github.com/bljohnsondev/mishos

    #mishos #webdev #selfhosted #selfhosting #foss #html #css #javascript #lit #webcomponents #golang #gin #gorm

  11. Version 0.2.8 of my Mishos TV tracking app has been released.

    - Added multi-user support
    - Added user roles for admin and user
    - Adding admin functionality for adding, editing and removing users

    github.com/bljohnsondev/mishos

    #mishos #webdev #selfhosted #selfhosting #foss #html #css #javascript #lit #webcomponents #golang #gin #gorm

  12. Forgot to add hashtags to this Mishos 0.2.7 release post. Adding here! See previous post for release details.

    Version 0.2.7 of my Mishos TV tracking app has been released.

    github.com/bljohnsondev/mishos

    #mishos #webdev #selfhosted #selfhosting #foss #html #css #javascript #lit #webcomponents #golang #gin #gorm

  13. Version 0.2.7 of my Mishos TV tracking app has been released.

    - Added show completion percentage to show details
    - Added unwatched count to the watch list
    - Added "Show Spoiler" option to user settings
    - Changed episode descriptions to use spoiler style "Show Description" button

    See release links for full details:

    github.com/bljohnsondev/mishos

    #mishos #webdev #selfhosted #selfhosting #foss #html #css #javascript #lit #webcomponents #golang #gin #gorm

  14. Version 0.2.5 of my Mishos TV tracking app has been released.

    Are there a lot of new features in this release? Sorry, no. Is it an important release? I think so!

    I've combined the Mishos images into a single image. Previously you had to run a frontend and backend image. No more!

    A single image also means less configuration.

    github.com/bljohnsondev/mishos

    #mishos #webdev #selfhosted #selfhosting #foss #html #css #javascript #lit #webcomponents #golang #gin #gorm

  15. Version 0.2.3 of my Mishos TV app has been released.

    I've added an export utility to get your TV watching data out in a JSON format. I've also added an "Ended" badge on the shows page so you know which of your shows have ended.

    For full release details see the following:

    github.com/bljohnsondev/mishos

    #webdev #selfhosted #selfhosting #foss #html #css #javascript #lit #webcomponents #golang #gin #gorm

  16. Another update of my Mishos self hosted web app for tracking TV shows!

    I've ripped out the NestJS backend and it's been rewritten in Go with Gin/Gorm. There has been a major performance increase with this rewrite. Marking previous watched episodes for long running shows has gone from taking minutes down to milliseconds.

    github.com/bljohnsondev/mishos

    #webdev #selfhosted #selfhosting #foss #html #css #javascript #lit #webcomponents #golang #gin #gorm

  17. A strange error in #golang #gorm

    I am connecting to a postgresql hosted on a server.

    When I use

    `DB, err := gorm.Open(postgres.Open(Config.DBUrl), &gorm.Config{})`

    I get an error saying " password authentication failed"

    But when I hard code the values

    `DB, err := gorm.Open(postgres.Open("user=s password=p host=h dbname=d"), &gorm.Config{})`

    it works.

    Any clue how to solve this?

  18. Playing around with #GoLang and #Gorm this afternoon, against an existing #AzureSql database. Was pretty easy to get up and running and I actually quite liked it, which I wouldn’t normally say about an ORM

  19. Object-Relational Mapping (ORM) в Golang

    Одна из самых важных задач ЯП`s это эффективное взаимодействие с базами данных и Go не исключение. В Go есть парадигма Object-Relational Mapping (ORM), позволяет работать с реляционными базами данных в терминах объектно-ориентированного программирования. Это очень сильно упрощает работу с базами данных, позволяя сосредоточиться на бизнес-логике приложения, а не на нюансах SQL-запросов. GORM (Go Object-Relational Mapping) предоставляет удобный интерфейс для взаимодействия с различными базами данных, сохраняя при этом идиоматичность и фичу конкуретности в Go.

    habr.com/ru/companies/otus/art

    #golang #gorm

  20. @gozes @kassner Gorm’s best methods are db.Raw().Scan() and db.Exec()

    For new projects please use sqlx it is able to clump arrays for example when using (“… IN ?”, arr) Instead of (“… IN (?, ?)”, arr[0], arr[1])

    pkg.go.dev/github.com/jmoiron/

  21. I don't like using normally but of does a bit better. And in go, SQL direct libs tend to be quite painful. Especially with all the foot guns. 😭

    gorm.io/

  22. @jakehamilton @geekgonecrazy Implicitly setting variables is something I do as well and where necessary using make (looking at you ) after you realize that arrays & slices can be nil without a pointer, var is almost a bug in the making

  23. @softinio I started writing most complicated queries using the raw method in and keeping the excellent database building to the orm.
    A mix can keep thing legible for the beginner and testable for the experts.

  24. Was der Langzeittest gibt, wird man sehen.

    Mein Hacker-❤️ habe ich natürlich an #GNUstep verloren: Die super durchdachte und offene API (#OpenStep), .apps/Bundles, sinnvolle Integrationen, Objective C und #Gorm (aiei.ch/gnustep/), Spalten-Filemanager mit #GWorkspace.
    Aber ich muss ja auch noch arbeiten… 😉
    #FLOSS #desktop