Skip to content

Commit 0b6adb9

Browse files
committed
chore: Improve inline Elixir docs
1 parent 6d1c81e commit 0b6adb9

1 file changed

Lines changed: 24 additions & 11 deletions

File tree

lib/ecto_libsql/native.ex

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ defmodule EctoLibSql.Native do
121121
@doc false
122122
def fetch_cursor(_conn_id, _cursor_id, _max_rows), do: :erlang.nif_error(:nif_not_loaded)
123123

124-
# Phase 1: Critical Production Features (v0.7.0)
125124
@doc false
126125
def set_busy_timeout(_conn_id, _timeout_ms), do: :erlang.nif_error(:nif_not_loaded)
127126

@@ -140,7 +139,6 @@ defmodule EctoLibSql.Native do
140139
@doc false
141140
def execute_transactional_batch_native(_conn_id, _sql), do: :erlang.nif_error(:nif_not_loaded)
142141

143-
# Phase 1: Statement Introspection & Savepoint Support (v0.7.0)
144142
@doc false
145143
def statement_column_count(_conn_id, _stmt_id), do: :erlang.nif_error(:nif_not_loaded)
146144

@@ -159,8 +157,6 @@ defmodule EctoLibSql.Native do
159157
@doc false
160158
def rollback_to_savepoint(_conn_id, _trx_id, _name), do: :erlang.nif_error(:nif_not_loaded)
161159

162-
# Phase 2: Advanced Replica Features
163-
164160
@doc false
165161
def get_frame_number(_conn_id), do: :erlang.nif_error(:nif_not_loaded)
166162

@@ -170,7 +166,30 @@ defmodule EctoLibSql.Native do
170166
@doc false
171167
def flush_replicator(_conn_id), do: :erlang.nif_error(:nif_not_loaded)
172168

173-
@doc false
169+
@doc """
170+
Get the highest frame number from write operations (for read-your-writes consistency).
171+
172+
This is a low-level NIF function that returns the maximum replication frame
173+
number from write operations on this database connection. It's primarily used
174+
internally by `get_max_write_frame/1`.
175+
176+
For most use cases, use `get_max_write_frame/1` instead, which provides better
177+
error handling and documentation.
178+
179+
## Parameters
180+
- conn_id: The connection ID (string)
181+
182+
## Returns
183+
- Integer frame number (0 if no writes tracked)
184+
- `{:error, reason}` if the connection is invalid
185+
186+
## Notes
187+
- This is a raw NIF function - prefer `get_max_write_frame/1` for normal usage
188+
- Returns 0 for local databases (not applicable)
189+
- Frame number increases with each write operation
190+
- Essential for implementing read-your-writes consistency in multi-replica setups
191+
192+
"""
174193
def max_write_replication_index(_conn_id), do: :erlang.nif_error(:nif_not_loaded)
175194

176195
# Internal NIF function - not supported, marked for deprecation
@@ -892,10 +911,6 @@ defmodule EctoLibSql.Native do
892911
end
893912
end
894913

895-
# ============================================================================
896-
# Phase 1: Statement Introspection & Savepoint Support (v0.7.0)
897-
# ============================================================================
898-
899914
@doc """
900915
Get the number of columns in a prepared statement's result set.
901916
@@ -1085,8 +1100,6 @@ defmodule EctoLibSql.Native do
10851100
{:error, "No active transaction"}
10861101
end
10871102

1088-
# Phase 2: Advanced Replica Features
1089-
10901103
@doc """
10911104
Get the current replication frame number from a remote replica.
10921105

0 commit comments

Comments
 (0)