Skip to content

Commit 90cb844

Browse files
committed
Fixed doc comment @return annotations
1 parent 9d50bbd commit 90cb844

File tree

1 file changed

+136
-121
lines changed

1 file changed

+136
-121
lines changed

src/sqlite3.mli

Lines changed: 136 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,16 @@ exception SqliteError of string
5555
(** {2 Library Information} *)
5656

5757
val sqlite_version : unit -> int
58-
(** [sqlite_version ()] @return the version of the SQLite3 library
59-
being used, in format [3XXXYYY] where [XXX] is the minor version and
60-
[YYY] is the patch level. For example, [3030001] for 3.30.1. *)
58+
(** [sqlite_version ()]
59+
@return
60+
the version of the SQLite3 library being used, in format [3XXXYYY] where
61+
[XXX] is the minor version and [YYY] is the patch level. For example,
62+
[3030001] for 3.30.1. *)
6163

6264
val sqlite_version_info : unit -> string
63-
(** [sqlite_version_info ()] @return the version of the SQLite3 library
64-
being used in a human-readable string. *)
65+
(** [sqlite_version_info ()]
66+
@return
67+
the version of the SQLite3 library being used in a human-readable string. *)
6568

6669
(** {2 Types} *)
6770

@@ -148,8 +151,9 @@ module Rc : sig
148151
code indicating success. *)
149152

150153
val is_success : t -> bool
151-
(** [is_success rc] @return [true] if [rc] indicates success ([OK] or
152-
[DONE]), [false] otherwise. *)
154+
(** [is_success rc]
155+
@return
156+
[true] if [rc] indicates success ([OK] or [DONE]), [false] otherwise. *)
153157
end
154158

155159
(** {2 Column data types} *)
@@ -330,30 +334,27 @@ val ( let& ) : db -> (db -> 'a) -> 'a
330334
@raise Fun.Finally_raised if the database could not be closed successfully. *)
331335

332336
val enable_load_extension : db -> bool -> bool
333-
(** [enable_load_extension db onoff] enable/disable the SQLite3 load
334-
extension. @return [false] if the operation fails, [true]
335-
otherwise. *)
337+
(** [enable_load_extension db onoff] enable/disable the SQLite3 load extension.
338+
@return [false] if the operation fails, [true] otherwise. *)
336339

337340
val errcode : db -> Rc.t
338-
(** [errcode db] @return the error code of the last operation on database
339-
[db].
341+
(** [errcode db]
342+
@return the error code of the last operation on database [db].
340343
341-
@raise SqliteError if an invalid database handle is passed.
342-
*)
344+
@raise SqliteError if an invalid database handle is passed. *)
343345

344346
val errmsg : db -> string
345-
(** [errmsg db] @return the error message of the last operation on
346-
database [db].
347+
(** [errmsg db]
348+
@return the error message of the last operation on database [db].
347349
348-
@raise SqliteError if an invalid database handle is passed.
349-
*)
350+
@raise SqliteError if an invalid database handle is passed. *)
350351

351352
val last_insert_rowid : db -> int64
352-
(** [last_insert_rowid db] @return the index of the row inserted by
353-
the last operation on database [db].
353+
(** [last_insert_rowid db]
354+
@return
355+
the index of the row inserted by the last operation on database [db].
354356
355-
@raise SqliteError if an invalid database handle is passed.
356-
*)
357+
@raise SqliteError if an invalid database handle is passed. *)
357358

358359
val exec : db -> ?cb:(row -> headers -> unit) -> string -> Rc.t
359360
(** [exec db ?cb sql] performs SQL-operation [sql] on database [db]. If the
@@ -408,10 +409,10 @@ val exec_not_null_no_headers : db -> cb:(row_not_null -> unit) -> string -> Rc.t
408409
@raise SqliteError if a row contains NULL. *)
409410

410411
val changes : db -> int
411-
(** [changes db] @return the number of rows that were changed
412-
or inserted or deleted by the most recently completed SQL statement
413-
on database [db].
414-
*)
412+
(** [changes db]
413+
@return
414+
the number of rows that were changed or inserted or deleted by the most
415+
recently completed SQL statement on database [db]. *)
415416

416417
(** {2 Prepared Statements} *)
417418

@@ -438,15 +439,16 @@ val prepare_or_reset : db -> stmt option ref -> string -> stmt
438439
@raise SqliteError if the statement could not be prepared or reset. *)
439440

440441
val prepare_tail : stmt -> stmt option
441-
(** [prepare_tail stmt] compile the remaining part of the SQL-statement
442-
[stmt] to bytecode. @return [None] if there was no remaining part,
443-
or [Some remaining_part] otherwise.
442+
(** [prepare_tail stmt] compile the remaining part of the SQL-statement [stmt]
443+
to bytecode.
444444
445-
NOTE: this really uses the C-function [sqlite3_prepare_v2],
446-
i.e. avoids the older, deprecated [sqlite3_prepare]-function.
445+
NOTE: this really uses the C-function [sqlite3_prepare_v2], i.e. avoids the
446+
older, deprecated [sqlite3_prepare]-function.
447447
448-
@raise SqliteError if the statement could not be prepared.
449-
*)
448+
@return
449+
[None] if there was no remaining part, or [Some remaining_part] otherwise.
450+
451+
@raise SqliteError if the statement could not be prepared. *)
450452

451453
val recompile : stmt -> unit
452454
(** [recompile stmt] recompiles the SQL-statement associated with [stmt] to
@@ -469,113 +471,121 @@ val finalize : stmt -> Rc.t
469471
(** {3 Data query} *)
470472

471473
val data_count : stmt -> int
472-
(** [data_count stmt] @return the number of columns in the result of
473-
the last step of statement [stmt].
474+
(** [data_count stmt]
475+
@return
476+
the number of columns in the result of the last step of statement [stmt].
474477
475-
@raise SqliteError if the statement is invalid.
476-
*)
478+
@raise SqliteError if the statement is invalid. *)
477479

478480
val column_count : stmt -> int
479-
(** [column_count stmt] @return the number of columns that would be
480-
returned by executing statement [stmt].
481+
(** [column_count stmt]
482+
@return
483+
the number of columns that would be returned by executing statement
484+
[stmt].
481485
482-
@raise SqliteError if the statement is invalid.
483-
*)
486+
@raise SqliteError if the statement is invalid. *)
484487

485488
val column : stmt -> int -> Data.t
486-
(** [column stmt n] @return the data in column [n] of the
487-
result of the last step of statement [stmt].
489+
(** [column stmt n]
490+
@return
491+
the data in column [n] of the result of the last step of statement [stmt].
488492
489493
@raise RangeError if [n] is out of range.
490-
@raise SqliteError if the statement is invalid.
491-
*)
494+
@raise SqliteError if the statement is invalid. *)
492495

493496
val column_bool : stmt -> int -> bool
494-
(** [column_bool stmt n] @return the data in column [n] of the
495-
result of the last step of statement [stmt] as a [bool].
497+
(** [column_bool stmt n]
498+
@return
499+
the data in column [n] of the result of the last step of statement [stmt]
500+
as a [bool].
496501
497502
@raise RangeError if [n] is out of range.
498-
@raise SqliteError if the statement is invalid.
499-
*)
503+
@raise SqliteError if the statement is invalid. *)
500504

501505
val column_text : stmt -> int -> string
502-
(** [column_text stmt n] @return the data in column [n] of the
503-
result of the last step of statement [stmt] as text (a [string]).
506+
(** [column_text stmt n]
507+
@return
508+
the data in column [n] of the result of the last step of statement [stmt]
509+
as text (a [string]).
504510
505511
@raise RangeError if [n] is out of range.
506-
@raise SqliteError if the statement is invalid.
507-
*)
512+
@raise SqliteError if the statement is invalid. *)
508513

509514
val column_int : stmt -> int -> int
510-
(** [column_int stmt n] @return the data in column [n] of the
511-
result of the last step of statement [stmt] as an [int].
515+
(** [column_int stmt n]
516+
@return
517+
the data in column [n] of the result of the last step of statement [stmt]
518+
as an [int].
512519
513520
@raise RangeError if [n] is out of range.
514521
@raise Failure if the integer conversion over- or underflows.
515-
@raise SqliteError if the statement is invalid.
516-
*)
522+
@raise SqliteError if the statement is invalid. *)
517523

518524
val column_nativeint : stmt -> int -> nativeint
519-
(** [column_nativeint stmt n] @return the data in column [n] of the
520-
result of the last step of statement [stmt] as a [nativeint].
525+
(** [column_nativeint stmt n]
526+
@return
527+
the data in column [n] of the result of the last step of statement [stmt]
528+
as a [nativeint].
521529
522530
@raise RangeError if [n] is out of range.
523531
@raise Failure if the integer conversion over- or underflows.
524-
@raise SqliteError if the statement is invalid.
525-
*)
532+
@raise SqliteError if the statement is invalid. *)
526533

527534
val column_int32 : stmt -> int -> int32
528-
(** [column_int32 stmt n] @return the data in column [n] of the result of
529-
the last step of statement [stmt] as an [int32]. Note that this function
530-
exactly corresponds to the C-library function [sqlite3_column_int]
531-
and does not check for over- or underflow during integer conversions.
535+
(** [column_int32 stmt n]
536+
@return
537+
the data in column [n] of the result of the last step of statement [stmt]
538+
as an [int32]. Note that this function exactly corresponds to the
539+
C-library function [sqlite3_column_int] and does not check for over- or
540+
underflow during integer conversions.
532541
533542
@raise RangeError if [n] is out of range.
534-
@raise SqliteError if the statement is invalid.
535-
*)
543+
@raise SqliteError if the statement is invalid. *)
536544

537545
val column_int64 : stmt -> int -> int64
538-
(** [column_int64 stmt n] @return the data in column [n] of the result of
539-
the last step of statement [stmt] as an [int64]. Note that this function
540-
exactly corresponds to the C-library function [sqlite3_column_int64]
541-
and does not check for over- or underflow during integer conversions.
546+
(** [column_int64 stmt n]
547+
@return
548+
the data in column [n] of the result of the last step of statement [stmt]
549+
as an [int64]. Note that this function exactly corresponds to the
550+
C-library function [sqlite3_column_int64] and does not check for over- or
551+
underflow during integer conversions.
542552
543553
@raise RangeError if [n] is out of range.
544-
@raise SqliteError if the statement is invalid.
545-
*)
554+
@raise SqliteError if the statement is invalid. *)
546555

547556
val column_double : stmt -> int -> float
548-
(** [column_double stmt n] @return the data in column [n] of the
549-
result of the last step of statement [stmt] as a double [float].
557+
(** [column_double stmt n]
558+
@return
559+
the data in column [n] of the result of the last step of statement [stmt]
560+
as a double [float].
550561
551562
@raise RangeError if [n] is out of range.
552-
@raise SqliteError if the statement is invalid.
553-
*)
563+
@raise SqliteError if the statement is invalid. *)
554564

555565
val column_blob : stmt -> int -> string
556-
(** [column_blob stmt n] @return the blob string in column [n] of the
557-
result of the last step of statement [stmt] as a [string].
566+
(** [column_blob stmt n]
567+
@return
568+
the blob string in column [n] of the result of the last step of statement
569+
[stmt] as a [string].
558570
559571
@raise RangeError if [n] is out of range.
560-
@raise SqliteError if the statement is invalid.
561-
*)
572+
@raise SqliteError if the statement is invalid. *)
562573

563574
val column_name : stmt -> int -> header
564-
(** [column_name stmt n] @return the header of column [n] in the
565-
result set of statement [stmt].
575+
(** [column_name stmt n]
576+
@return the header of column [n] in the result set of statement [stmt].
566577
567578
@raise RangeError if [n] is out of range.
568-
@raise SqliteError if the statement is invalid.
569-
*)
579+
@raise SqliteError if the statement is invalid. *)
570580

571581
val column_decltype : stmt -> int -> string option
572-
(** [column_decltype stmt n] @return the declared type of the specified
573-
column in the result set of statement [stmt] as [Some str] if available,
574-
or as [None] otherwise.
582+
(** [column_decltype stmt n]
583+
@return
584+
the declared type of the specified column in the result set of statement
585+
[stmt] as [Some str] if available, or as [None] otherwise.
575586
576587
@raise RangeError if [n] is out of range.
577-
@raise SqliteError if the statement is invalid.
578-
*)
588+
@raise SqliteError if the statement is invalid. *)
579589

580590
(** {3 Binding data to statements} *)
581591

@@ -694,28 +704,27 @@ val bind_names : stmt -> (string * Data.t) list -> Rc.t
694704
@raise SqliteError if the statement is invalid. *)
695705

696706
val bind_parameter_count : stmt -> int
697-
(** [bind_parameter_count stmt] @return the number of free variables in
698-
statement [stmt].
707+
(** [bind_parameter_count stmt]
708+
@return the number of free variables in statement [stmt].
699709
700-
@raise SqliteError if the statement is invalid.
701-
*)
710+
@raise SqliteError if the statement is invalid. *)
702711

703712
val bind_parameter_name : stmt -> int -> string option
704-
(** [bind_parameter_name stmt pos] @return [Some parameter_name] of the free
705-
variable at position [pos] of statement [stmt], or [None] if it is
706-
ordinary ("?").
713+
(** [bind_parameter_name stmt pos]
714+
@return
715+
[Some parameter_name] of the free variable at position [pos] of statement
716+
[stmt], or [None] if it is ordinary ("?").
707717
708718
@raise RangeError if [pos] is out of range.
709-
@raise SqliteError if the statement is invalid.
710-
*)
719+
@raise SqliteError if the statement is invalid. *)
711720

712721
val bind_parameter_index : stmt -> string -> int
713-
(** [bind_parameter_index stmt name] @return the position of the free
714-
variable with name [name] in statement [stmt].
722+
(** [bind_parameter_index stmt name]
723+
@return
724+
the position of the free variable with name [name] in statement [stmt].
715725
716726
@raise Not_found if [name] was not found.
717-
@raise SqliteError if the statement is invalid.
718-
*)
727+
@raise SqliteError if the statement is invalid. *)
719728

720729
val clear_bindings : stmt -> Rc.t
721730
(** [clear_bindings stmt] resets all bindings associated with prepared statement
@@ -766,32 +775,36 @@ val fold : stmt -> f:('a -> Data.t array -> 'a) -> init:'a -> Rc.t * 'a
766775
(** {3 Stepwise query convenience functions} *)
767776

768777
val row_blobs : stmt -> string array
769-
(** [row_blobs stmt] @return the blobs returned by the last query step performed
770-
with statement [stmt] (array of blobs).
778+
(** [row_blobs stmt]
779+
@return
780+
the blobs returned by the last query step performed with statement [stmt]
781+
(array of blobs).
771782
772-
@raise SqliteError if the statement is invalid.
773-
*)
783+
@raise SqliteError if the statement is invalid. *)
774784

775785
val row_data : stmt -> Data.t array
776-
(** [row_data stmt] @return all data values in the row returned by the
777-
last query step performed with statement [stmt].
786+
(** [row_data stmt]
787+
@return
788+
all data values in the row returned by the last query step performed with
789+
statement [stmt].
778790
779-
@raise SqliteError if the statement is invalid.
780-
*)
791+
@raise SqliteError if the statement is invalid. *)
781792

782793
val row_names : stmt -> headers
783-
(** [row_names stmt] @return all column headers of the row returned by the
784-
last query step performed with statement [stmt].
794+
(** [row_names stmt]
795+
@return
796+
all column headers of the row returned by the last query step performed
797+
with statement [stmt].
785798
786-
@raise SqliteError if the statement is invalid.
787-
*)
799+
@raise SqliteError if the statement is invalid. *)
788800

789801
val row_decltypes : stmt -> string option array
790-
(** [row_decltypes stmt] @return all column type declarations of the
791-
row returned by the last query step performed with statement [stmt].
802+
(** [row_decltypes stmt]
803+
@return
804+
all column type declarations of the row returned by the last query step
805+
performed with statement [stmt].
792806
793-
@raise SqliteError if the statement is invalid.
794-
*)
807+
@raise SqliteError if the statement is invalid. *)
795808

796809
(** {2 User-defined functions} *)
797810

@@ -959,5 +972,7 @@ val busy_timeout : db -> int -> unit
959972
@raise SqliteError if an invalid database handle is passed. *)
960973

961974
val sleep : int -> int
962-
(** [sleep ms] sleeps at least [ms] milliseconds. @return the number of
963-
milliseconds of sleep actually requested from the operating system. *)
975+
(** [sleep ms] sleeps at least [ms] milliseconds.
976+
@return
977+
the number of milliseconds of sleep actually requested from the operating
978+
system. *)

0 commit comments

Comments
 (0)