package current
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Pipeline language for keeping things up-to-date
Install
dune-project
Dependency
Authors
-
TThomas Leonard <talex5@gmail.com>
-
AAntonin Décimo <antonin@tarides.com>
-
TTim McGilchrist <timmcgil@gmail.com>
-
CCraig Ferguson <me@craigfe.io>
-
EEtienne MARAIS <etienne@maiste.fr>
-
AAnil Madhavapeddy <anil@recoil.org>
-
David Allsopp
-
EEwan Mellor <ewan@tarides.com>
-
KKate <kit.ty.kate@disroot.org>
-
MMark Elvers <mark.elvers@tunbury.org>
-
PPuneeth Chaganti <punchagan@muse-amuse.in>
-
LLucas Pluvinage <lucas@tarides.com>
-
NNavin Keswani <navin@novemberkilo.com>
-
TThomas Gazagnaire <thomas@gazagnaire.org>
-
Patrick Ferris
-
AArthur Wendling <art.wendling@gmail.com>
-
AAnurag Soni <anurag@sonianurag.com>
-
AAmbre Austen Suhamy <ambre@tarides.com>
-
BBen Andrew <benmandrew@gmail.com>
-
GGargi Sharma <gs051095@gmail.com>
-
JJonathan Coates <git@squiddev.cc>
-
JJules Aguillon <juloo.dsi@gmail.com>
-
MMagnus Skjegstad <magnus@skjegstad.com>
-
SShon Feder <shon.feder@gmail.com>
-
Ssmolck <46855713+smolck@users.noreply.github.com>
-
Ttatchi <corentin.leruth@gmail.com>
Maintainers
Sources
ocurrent-0.7.3.tbz
md5=7cc6b5cb4158e01444c92082fc7fc88d
sha512=5576b26377d470bdd4cbdb58d4cc4bcc3b62258ed9768b589bcae09f16919d7748d93cac34f35b6da20972dde356f57eadc00ef832f7cb939a42ce0689fc4104
doc/src/current/db.ml.html
Source file db.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65type t = Sqlite3.db let or_fail ~cmd x = match x with | Sqlite3.Rc.OK -> () | err -> Fmt.failwith "Sqlite3: %s (executing %S)" (Sqlite3.Rc.to_string err) cmd let no_callback _ = failwith "[exec] used with a query!" let exec_stmt ?(cb=no_callback) stmt = let rec loop () = match Sqlite3.step stmt with | Sqlite3.Rc.DONE -> () | Sqlite3.Rc.ROW -> let cols = Sqlite3.data_count stmt in cb @@ List.init cols (fun i -> Sqlite3.column stmt i); loop () | x -> Fmt.failwith "Sqlite3 exec error: %s" (Sqlite3.Rc.to_string x) in loop () let exec_literal db sql = Sqlite3.exec db sql |> or_fail ~cmd:sql let bind stmt values = Sqlite3.reset stmt |> or_fail ~cmd:"reset"; List.iteri (fun i v -> Sqlite3.bind stmt (i + 1) v |> or_fail ~cmd:"bind") values let exec stmt values = bind stmt values; exec_stmt stmt let query stmt values = bind stmt values; let results = ref [] in let cb row = results := row :: !results in exec_stmt ~cb stmt; List.rev !results let query_one stmt values = match query stmt values with | [row] -> row | [] -> failwith "No results from SQL query!" | _ -> failwith "Multiple results from SQL query!" let query_some stmt values = match query stmt values with | [] -> None | [row] -> Some row | _ -> failwith "Multiple results from SQL query!" let v = lazy ( let db_dir = Disk_store.state_dir "db" in let db = Sqlite3.db_open Fpath.(to_string (db_dir / "sqlite.db")) in Sqlite3.busy_timeout db 1000; exec_literal db "PRAGMA journal_mode=WAL"; exec_literal db "PRAGMA synchronous=NORMAL"; db ) let dump_item = Fmt.of_to_string Sqlite3.Data.to_string_debug let dump_row = Fmt.(Dump.list dump_item)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>