orm

SQL generation: Golang’s builder pattern vs Clojure’s persistent map

SQL generation: Golang’s builder pattern vs Clojure’s persistent map

I worked on a TODO code assignment for showing off my skills, and more importantly, showing my weak points. I coded in Golang and Masterminds/squirrel. Later, I ported only the SQL generation part to Clojure to compare and discuss why I prefer Clojure, which I have usually been asked about or even met with opposition for. I will discuss function by function and type by type. The first function is makeStatement. func (repo *TodoRepoPg) makeStatement(orders []entity.Order, filters []entity.Filter) (string, []any, error) { builder := repo.Builder.Select("id, title, description, created, image, status") if err := buildOrders(&builder, orders); err != nil { return…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.