Skip to content

Commit aa92399

Browse files
committed
Prepared new release
1 parent f8e8400 commit aa92399

File tree

8 files changed

+103
-16
lines changed

8 files changed

+103
-16
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2015-08-29: Added user function error handling (major API change).
2+
3+
Thanks to Joseph Young for this patch!
4+
15
2015-01-29: Fixed a build problem due to Oasis/ocamlbuild inconsistency.
26

37
Thanks to Leonid Rozenberg <[email protected]> for this patch!

INSTALL.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(* OASIS_START *)
2-
(* DO NOT EDIT (digest: dd3cb7c4515a29aaa64bbcda8b16a781) *)
2+
(* DO NOT EDIT (digest: ca1786acdafc1c9f2a8fdd7a5247f689) *)
33

44
This is the INSTALL file for the sqlite3 distribution.
55

@@ -11,8 +11,8 @@ Dependencies
1111

1212
In order to compile this package, you will need:
1313

14-
* ocaml (>= 3.12) for all, test test_agg, test test_db, test test_exec,
15-
test test_fun, test test_stmt, doc API
14+
* ocaml (>= 3.12) for all, test test_agg, test test_db, test test_error,
15+
test test_exec, test test_fun, test test_stmt, doc API
1616
* findlib (>= 1.3.1)
1717

1818
Installing

_oasis

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
OASISFormat: 0.4
22
Name: sqlite3
3-
Version: 2.0.9
3+
Version: 3.0.0
44
Synopsis: sqlite3-ocaml - SQLite3 bindings
55
Description: sqlite3-ocaml is an OCaml library with bindings to the
66
SQLite3 client API. Sqlite3 is a self-contained, serverless,
@@ -124,6 +124,7 @@ Test test_error
124124
Run$: flag(tests)
125125
Command: $test_error
126126
WorkingDirectory: test
127+
PostCommand: rm t
127128

128129
#
129130

_tags

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: 3fd9cff80b9dcdb8cdf52535e63056b7)
2+
# DO NOT EDIT (digest: 861fe4675b9540776aedfbf5f54a58d7)
33
# Ignore VCS directories, you can use the same kind of rule outside
44
# OASIS_START/STOP if you want to exclude directories that contains
55
# useless stuff for the build process
@@ -36,6 +36,8 @@ true: annot, bin_annot
3636
<test/*.ml{,i,y}>: pkg_str
3737
# Executable test_stmt
3838
<test/test_stmt.{native,byte}>: use_sqlite3
39+
# Executable test_error
40+
<test/test_error.{native,byte}>: use_sqlite3
3941
<test/*.ml{,i,y}>: use_sqlite3
4042
# OASIS_STOP
4143

lib/META

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: f2411e0a0d6c8bb3fee87a6bf3f386db)
3-
version = "2.0.9"
2+
# DO NOT EDIT (digest: fc7db74acb0529e253896e714e0a428b)
3+
version = "3.0.0"
44
description = "sqlite3-ocaml - SQLite3 bindings"
55
archive(byte) = "sqlite3.cma"
66
archive(byte, plugin) = "sqlite3.cma"

lib/sqlite3_stubs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,7 @@ CAMLprim value caml_sqlite3_bind(value v_stmt, value v_index, value v_data)
847847
String_val(v_field),
848848
caml_string_length(v_field),
849849
SQLITE_TRANSIENT));
850-
case 4 :
851-
return Val_rc(SQLITE_ERROR);
850+
case 4 : return Val_rc(SQLITE_ERROR);
852851
}
853852
}
854853
return Val_rc(SQLITE_ERROR);

setup.ml

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(* setup.ml generated for the first time by OASIS v0.3.0 *)
22

33
(* OASIS_START *)
4-
(* DO NOT EDIT (digest: 3743f09fc72577ad3af91b1ab47847de) *)
4+
(* DO NOT EDIT (digest: 51146b2c34f38bae10732375ae42aa0e) *)
55
(*
66
Regenerated by OASIS v0.4.5
77
Visit http://oasis.forge.ocamlcore.org for more information and
@@ -6844,6 +6844,14 @@ let setup_t =
68446844
[(OASISExpr.EBool true, ("$test_stmt", []))];
68456845
cmd_clean = [(OASISExpr.EBool true, None)];
68466846
cmd_distclean = [(OASISExpr.EBool true, None)]
6847+
});
6848+
("test_error",
6849+
CustomPlugin.Test.main
6850+
{
6851+
CustomPlugin.cmd_main =
6852+
[(OASISExpr.EBool true, ("$test_error", []))];
6853+
cmd_clean = [(OASISExpr.EBool true, None)];
6854+
cmd_distclean = [(OASISExpr.EBool true, None)]
68476855
})
68486856
];
68496857
doc =
@@ -6896,6 +6904,14 @@ let setup_t =
68966904
[(OASISExpr.EBool true, ("$test_stmt", []))];
68976905
cmd_clean = [(OASISExpr.EBool true, None)];
68986906
cmd_distclean = [(OASISExpr.EBool true, None)]
6907+
});
6908+
("test_error",
6909+
CustomPlugin.Test.clean
6910+
{
6911+
CustomPlugin.cmd_main =
6912+
[(OASISExpr.EBool true, ("$test_error", []))];
6913+
cmd_clean = [(OASISExpr.EBool true, None)];
6914+
cmd_distclean = [(OASISExpr.EBool true, None)]
68996915
})
69006916
];
69016917
clean_doc =
@@ -6946,6 +6962,14 @@ let setup_t =
69466962
[(OASISExpr.EBool true, ("$test_stmt", []))];
69476963
cmd_clean = [(OASISExpr.EBool true, None)];
69486964
cmd_distclean = [(OASISExpr.EBool true, None)]
6965+
});
6966+
("test_error",
6967+
CustomPlugin.Test.distclean
6968+
{
6969+
CustomPlugin.cmd_main =
6970+
[(OASISExpr.EBool true, ("$test_error", []))];
6971+
cmd_clean = [(OASISExpr.EBool true, None)];
6972+
cmd_distclean = [(OASISExpr.EBool true, None)]
69496973
})
69506974
];
69516975
distclean_doc = [];
@@ -6957,7 +6981,7 @@ let setup_t =
69576981
alpha_features = [];
69586982
beta_features = [];
69596983
name = "sqlite3";
6960-
version = "2.0.9";
6984+
version = "3.0.0";
69616985
license =
69626986
OASISLicense.DEP5License
69636987
(OASISLicense.DEP5Unit
@@ -7372,6 +7396,63 @@ let setup_t =
73727396
test_tools =
73737397
[ExternalTool "ocamldoc"; ExternalTool "ocamlbuild"]
73747398
});
7399+
Executable
7400+
({
7401+
cs_name = "test_error";
7402+
cs_data = PropList.Data.create ();
7403+
cs_plugin_data = []
7404+
},
7405+
{
7406+
bs_build =
7407+
[
7408+
(OASISExpr.EBool true, false);
7409+
(OASISExpr.EFlag "tests", true)
7410+
];
7411+
bs_install = [(OASISExpr.EBool true, false)];
7412+
bs_path = "test";
7413+
bs_compiled_object = Best;
7414+
bs_build_depends = [InternalLibrary "sqlite3"];
7415+
bs_build_tools =
7416+
[ExternalTool "ocamldoc"; ExternalTool "ocamlbuild"];
7417+
bs_c_sources = [];
7418+
bs_data_files = [];
7419+
bs_ccopt = [(OASISExpr.EBool true, [])];
7420+
bs_cclib = [(OASISExpr.EBool true, [])];
7421+
bs_dlllib = [(OASISExpr.EBool true, [])];
7422+
bs_dllpath = [(OASISExpr.EBool true, [])];
7423+
bs_byteopt = [(OASISExpr.EBool true, [])];
7424+
bs_nativeopt = [(OASISExpr.EBool true, [])]
7425+
},
7426+
{exec_custom = false; exec_main_is = "test_error.ml"});
7427+
Test
7428+
({
7429+
cs_name = "test_error";
7430+
cs_data = PropList.Data.create ();
7431+
cs_plugin_data = []
7432+
},
7433+
{
7434+
test_type = (`Test, "custom", Some "0.4");
7435+
test_command =
7436+
[(OASISExpr.EBool true, ("$test_error", []))];
7437+
test_custom =
7438+
{
7439+
pre_command = [(OASISExpr.EBool true, None)];
7440+
post_command =
7441+
[(OASISExpr.EBool true, Some (("rm", ["t"])))]
7442+
};
7443+
test_working_directory = Some "test";
7444+
test_run =
7445+
[
7446+
(OASISExpr.ENot (OASISExpr.EFlag "tests"), false);
7447+
(OASISExpr.EFlag "tests", false);
7448+
(OASISExpr.EAnd
7449+
(OASISExpr.EFlag "tests",
7450+
OASISExpr.EFlag "tests"),
7451+
true)
7452+
];
7453+
test_tools =
7454+
[ExternalTool "ocamldoc"; ExternalTool "ocamlbuild"]
7455+
});
73757456
Doc
73767457
({
73777458
cs_name = "API";
@@ -7430,14 +7511,14 @@ let setup_t =
74307511
};
74317512
oasis_fn = Some "_oasis";
74327513
oasis_version = "0.4.5";
7433-
oasis_digest = Some "\144 ¥N\011\016òíBEêµãé";
7514+
oasis_digest = Some "µ¢]]±\1486t\133\000&¿º M£";
74347515
oasis_exec = None;
74357516
oasis_setup_args = [];
74367517
setup_update = false
74377518
};;
74387519

74397520
let setup () = BaseSetup.setup setup_t;;
74407521

7441-
# 7442 "setup.ml"
7522+
# 7523 "setup.ml"
74427523
(* OASIS_STOP *)
74437524
let () = setup ();;

test/test_error.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
open Sqlite3
22

33
(* Tests our ability to return an error from a user defined function *)
4-
let _ =
4+
let () =
55
let db = db_open "t" in
66
create_fun0 db "MYERROR" (fun () -> Data.ERROR "This function always errors");
77
let res = exec db "SELECT MYERROR();" in
@@ -10,9 +10,9 @@ let _ =
1010
| x -> prerr_endline ("Should have thrown an error: " ^ Rc.to_string x)
1111

1212
(* Insures that we can't bind an error to a query *)
13-
let _ =
13+
let () =
1414
let db = db_open "t" in
15-
let _ = exec db "CREATE TABLE foo (val text);" in
15+
let _ : Rc.t = exec db "CREATE TABLE foo (val text);" in
1616
let s = Sqlite3.prepare db "INSERT INTO foo values (?);" in
1717
let res = Sqlite3.bind s 1 (Sqlite3.Data.ERROR "Should be impossible") in
1818
match res with

0 commit comments

Comments
 (0)