import csv
class _LineBuffer:
def __init__(self):
self._data = ""
module Keysettable
extend ActiveSupport::Concern
included do
scope :keyset_page, ->(after: nil, limit: 20) do
relation = order(created_at: :asc, id: :asc).limit(limit + 1)
class Current < ActiveSupport::CurrentAttributes
attribute :tenant, :request_id
def tenant=(tenant)
super
Rails.logger.tagged("tenant=#{tenant&.id}") if tenant
import base64
import json
from datetime import datetime
class InvalidCursor(Exception):
class CreateAuditLogs < ActiveRecord::Migration[7.1]
def change
create_table :audit_logs do |t|
t.references :auditable, polymorphic: true, null: false
t.references :user, null: true, foreign_key: true
t.string :action, null: false
import { Injectable, Scope } from '@nestjs/common';
import { DataSource, EntityManager, QueryRunner } from 'typeorm';
@Injectable({ scope: Scope.REQUEST })
export class TransactionContext {
private queryRunner?: QueryRunner;
package com.example.docs.domain;
import jakarta.persistence.*;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import uuid
from django.db import models
from django.utils import timezone
class OutboxManager(models.Manager):
import { Knex } from 'knex';
export interface RawDailyRow {
day: string;
order_count: string;
gross_cents: string;
class Cart < ApplicationRecord
has_many :cart_items, dependent: :destroy
EXPIRY_WINDOW = 2.hours
scope :active, -> { where(state: :active) }
import base64
import json
from django.core.exceptions import BadRequest
package export
import (
"encoding/csv"
"log"
"net/http"