1 //go:build !(js && wasm)
2 3 package database
4 5 import (
6 "io"
7 8 "next.orly.dev/pkg/lol/chk"
9 "next.orly.dev/pkg/lol/log"
10 )
11 12 // Import a collection of events in line structured minified JSON format (JSONL).
13 // This runs synchronously to ensure the reader remains valid during processing.
14 // The actual event processing happens after buffering to a temp file, so the
15 // caller can close the reader after Import returns.
16 func (d *D) Import(rr io.Reader) {
17 if err := d.ImportEventsFromReader(d.ctx, rr); chk.E(err) {
18 log.E.F("import failed: %v", err)
19 }
20 }
21