<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/contains-some-bad-choices-g33yumypt" -->

---
title: Contains Some Bad Choices | daily.dev
description: A code review story from The Daily WTF examining a developer's unnecessary reimplementation of Postgres array string formatting in JavaScript when using the...
canonical: https://daily.dev/posts/contains-some-bad-choices-g33yumypt
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Contains Some Bad Choices | daily.dev
og:description: A code review story from The Daily WTF examining a developer's unnecessary reimplementation of Postgres array string formatting in JavaScript when using the...
og:url: https://daily.dev/posts/contains-some-bad-choices-g33yumypt
og:image: https://api.daily.dev/og/posts/G33yUmyPt.png
og:image:alt: Contains Some Bad Choices
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Contains Some Bad Choices

**[The Daily WTF](https://daily.dev/sources/thedailywtf)** · 3 min read · 0 upvotes · 0 comments

## Summary

A code review story from The Daily WTF examining a developer's unnecessary reimplementation of Postgres array string formatting in JavaScript when using the Knex query builder. The code manually constructs Postgres array syntax and builds parameterized query arrays, despite Knex's `whereRaw` already handling this natively. The post also touches on the broader anti-pattern of accumulating poorly reinvented utility functions in a catch-all file, and includes a minor tip on optimizing comma-separated string generation in loops.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://thedailywtf.com/articles/contains-some-bad-choices>

## Similar posts on daily.dev

- [How ORMs Still Let SQL Injection Through \(and How to Close the Gaps\)](https://daily.dev/posts/how-orms-still-let-sql-injection-through-and-how-to-close-the-gaps--uwxttxmz8) · freeCodeCamp · 67 upvotes · 2 comments
- [A Random Article](https://daily.dev/posts/a-random-article-kigeqrvkp) · The Daily WTF · 0 upvotes · 2 comments
- [JavaScript ES2026 is Less About New Syntax — and More About Writing Better Code](https://daily.dev/posts/javascript-es2026-is-less-about-new-syntax-and-more-about-writing-better-code-0zsgaegpc) · Medium · 1 upvotes · 0 comments
- [20 Mistakes That Quietly Destroy JavaScript/TypeScript Codebases \(Part 2\)](https://daily.dev/posts/20-mistakes-that-quietly-destroy-javascript-typescript-codebases-part-2--lgbflmz2i) · The T-Shaped Dev · 59 upvotes · 1 comments
- [I Know a Query’s Gonna Be Bad When… \#TSQL2sday](https://daily.dev/posts/i-know-a-query-s-gonna-be-bad-when-tsql2sday-ngvz4dujq) · Brent Ozar · 0 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#nodejs](https://daily.dev/tags/nodejs), [#sql](https://daily.dev/tags/sql), [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/contains-some-bad-choices-g33yumypt)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Contains Some Bad Choices","url":"https://daily.dev/posts/contains-some-bad-choices-g33yumypt","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/contains-some-bad-choices-g33yumypt"},"datePublished":"2026-02-18T11:38:46.429Z","dateModified":"2026-02-18T11:39:05.748Z","description":"A code review story from The Daily WTF examining a developer's unnecessary reimplementation of Postgres array string formatting in JavaScript when using the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/677fcc59be1ff9fab043338edbaa89c2?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/677fcc59be1ff9fab043338edbaa89c2?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"The Daily WTF","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"The Daily WTF","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/d21a6aa61a7244d893a3b3284df8e2ef","url":"https://daily.dev/sources/thedailywtf"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/contains-some-bad-choices-g33yumypt","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"javascript,nodejs,sql,postgresql","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"The Daily WTF","item":"https://daily.dev/sources/thedailywtf"},{"@type":"ListItem","position":3,"name":"Contains Some Bad Choices"}]}
```

