Skip to main content

Module db

Module db 

Source
Expand description

The Db glue: how Tablo code reaches the pooled Toasty database, and the transaction a panel write runs its record fns and hooks in.

Functions§

count
How many rows query holds, counted on the pooled [Db]: a model’s query, such as Post::filter(..), or a Query such as list_query’s.
count_in
How many rows query holds, counted through ex: inside the transaction a record fn or a hook received, so the count sees the rows the write has made so far and a limit check holds against concurrent writes the isolation level orders. Reads 0 where Toasty answers no value, as count does.
db
Returns the pooled [Db] registered on the router.