require "csv"
class PeopleCsvStream
include Enumerable
HEADERS = %w[id full_name email signed_up_at plan].freeze
package pools
import (
"bytes"
"sync"
)
class Tag < ApplicationRecord
has_many :taggings, dependent: :destroy
scope :top, ->(limit = 20) {
joins(:taggings)
.group(Arel.sql("tags.id"))
use std::mem::MaybeUninit;
fn main() {
let mut uninit: MaybeUninit<i32> = MaybeUninit::uninit();
unsafe {
uninit.as_mut_ptr().write(42);
class Order < ApplicationRecord
belongs_to :customer
scope :for_export, -> {
select(:id, :reference, :total_cents, :currency, :created_at, :customer_id)
.where.not(exported_at: nil)
package main
import (
"os"
"runtime/debug"
"strconv"
use std::collections::HashMap;
use std::hash::Hash;
const NIL: usize = usize::MAX;
struct Node<K, V> {
<?php
namespace App\Exports;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Carbon;
from sqlalchemy import select
from .models import Order, db
def stream_orders(batch_size=1000):
import csv
class _LineBuffer:
def __init__(self):
self._data = ""
@RestController
@RequestMapping("/api/exports")
public class ExportController {
private final CsvStreamWriter csvStreamWriter;
use std::mem;
fn main() {
let mut x = 5;
let mut y = 10;