Spyke

Posts

programming·Programmingbyismail

TypeSQL: write plain SQL strings, get exact TypeScript types (no codegen)

I created this new library that parses Postgres SQL inside TypeScript’s type system. You write a SQL string and the compiler infers the row and parameter types. It needs no codegen and no database connection.

const q = sql(`SELECT u.id, u.email, p.title
               FROM users u LEFT JOIN posts p ON p.author_id = u.id
               WHERE u.id = ${sql.param(7)}`);
// { id: number; email: string; title: string | null }

sql("SELECT nme FROM users");
// error: column "nme" does not exist
  • Handles joins, CTEs, subqueries, window functions, INSERT/UPDATE/DELETE … RETURNING
  • Runs on pg or postgres.js, and can reuse your existing Kysely, Drizzle or Prisma schema
  • Requires TypeScript 7

https://github.com/ismailkarsli/typesql

Feedback welcome, especially queries that don’t type-check but should.

View original on lemmy.ml
1
fediverse·Fediversebyismail

Meta to close Threads in Turkey to comply with injunction prohibiting data sharing with Instagram

Meta said on Monday that it plans to “temporarily” shutter Threads in Turkey from April 29, in response to an interim injunction imposed by the Turkish competition authority last month over the way Meta shares data between Threads and Instagram.

The Turkish Competition Authority (TCA), known as Rekabet Kurumu, noted on March 18 that its investigations found that Meta was abusing its dominant market position by combining the data of users who create Threads profiles with that of their Instagram account — without giving users the choice to opt-in.

Meta to close Threads in Turkey to comply with injunction prohibiting data sharing with Instagramhttps://techcrunch.com/2024/04/15/meta-to-close-threads-in-turkey-to-comply-with-injunction-prohibiting-data-sharing-with-instagram/Open linkView original on lemmy.ml
136
turkey·Turkey 🇹🇷byismail

Meta to close Threads in Turkey to comply with injunction prohibiting data sharing with Instagram

Meta said on Monday that it plans to “temporarily” shutter Threads in Turkey from April 29, in response to an interim injunction imposed by the Turkish competition authority last month over the way Meta shares data between Threads and Instagram.

The Turkish Competition Authority (TCA), known as Rekabet Kurumu, noted on March 18 that its investigations found that Meta was abusing its dominant market position by combining the data of users who create Threads profiles with that of their Instagram account — without giving users the choice to opt-in.

Meta to close Threads in Turkey to comply with injunction prohibiting data sharing with Instagramhttps://techcrunch.com/2024/04/15/meta-to-close-threads-in-turkey-to-comply-with-injunction-prohibiting-data-sharing-with-instagram/Open linkView original on lemmy.ml
11

You reached the end