Skip to content

Instantly share code, notes, and snippets.

@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active August 11, 2025 10:39
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@danielpowell4
danielpowell4 / rls-prisma-extension.test.ts
Last active July 19, 2025 06:40
RLS Extension for Prisma with wrapping jest test
import { Prisma, PrismaClient } from '@prisma/client';
import get from 'lodash.get';
describe('prisma extensions', () => {
it('RLS extension sets app policy helpers', async () => {
// #region setup
const userId = 'user_123';
const organizationId = 'org_456';
const membershipRole = 'admin';
const setRlsSql = Prisma.sql`SELECT set_rls_app_context(${userId}, ${organizationId}, ${membershipRole});`;