Skip to content

Commit f700091

Browse files
committed
Now builds docs (with latest version of compiler if gen-package-version
is updated)
1 parent 2ff1a96 commit f700091

24 files changed

+82
-60
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
/docs/docs.json
1212
/docs/public/mysql/
13+
/docs/public/taggedalgebraic/
1314
/docs/public/file_hashes.json
1415
/docs/public/index.html
1516
/docs/public/mysql.html

build-docs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,18 @@ rm -rf docs_tmp ta
1616
rm source/mysql/package.o
1717

1818
dub --version
19-
dub run gen-package-version -- mysql --ddoc=ddoc --src=source
19+
if ! dub run gen-package-version -- mysql --ddoc=ddoc --src=source; then
20+
echo "Failed to build gen-package-version"
21+
exit 1
22+
fi
2023
rm source/mysql/packageVersion.d
2124

2225
echo Building ddox...
2326
cd ./ddox
24-
dub build
27+
if ! dub build; then
28+
echo "Failed to build ddox"
29+
exit 1
30+
fi
2531
cd ..
2632
echo Done building ddox...
2733

examples/homePage/dub.selections.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"libev": "5.0.0+4.04",
77
"libevent": "2.0.1+2.0.16",
88
"memutils": "0.4.13",
9+
"mysql-native": {"path":"../.."},
910
"openssl": "1.1.4+1.0.1g",
1011
"stdx-allocator": "2.77.5",
1112
"taggedalgebraic": "0.11.8",

source/mysql/commands.d

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
/++
2-
This module publicly imports `mysql.unsafe.commands`, which provides the
3-
Variant-based interface to mysql. In the future, this will switch to importing the
4-
`mysql.safe.commands`, which provides the @safe interface to mysql. Please see
5-
those two modules for documentation on the functions provided. It is highly
6-
recommended to import `mysql.safe.commands` and not the unsafe commands, as
7-
that is the future for mysql-native.
2+
This module publicly imports `mysql.unsafe.commands`. Please see that module for more documentation.
83
94
In the far future, the unsafe version will be deprecated and removed, and the
105
safe version moved to this location.

source/mysql/connection.d

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
/++
2-
This module publicly imports `mysql.unsafe.connection`, which provides
3-
backwards compatible functions for connecting to a MySQL/MariaDB server.
4-
5-
It is recommended instead to import `mysql.safe.connection`, which provides
6-
@safe-only mechanisms to connect to a database.
7-
8-
Note that the common pieces of the connection are documented and currently
9-
reside in `mysql.impl.connection`. The safe and unsafe portions of the API
10-
reside in `mysql.unsafe.connection` and `mysql.safe.connection` respectively.
11-
Please see these modules for information on using a MySQL `Connection` object.
2+
This module publicly imports `mysql.unsafe.connection`. Please see that module
3+
for more documentation.
124
135
In the future, this will migrate to importing `mysql.safe.connection`. In the
146
far future, the unsafe version will be deprecated and removed, and the safe

source/mysql/impl/connection.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/++
2-
Connect to a MySQL/MariaDB server.
2+
Implementation - Connection class.
33
44
WARNING:
55
This module is used to consolidate the common implementation of the safe and
@@ -1132,15 +1132,15 @@ unittest
11321132
cn.exec("DROP TABLE `dropConnection`");
11331133
}
11341134

1135-
/+
1135+
/*
11361136
Test Prepared's ability to be safely refcount-released during a GC cycle
11371137
(ie, `Connection.release` must not allocate GC memory).
11381138
11391139
Currently disabled because it's not guaranteed to always work
11401140
(and apparently, cannot be made to work?)
11411141
For relevant discussion, see issue #159:
11421142
https://github.com/mysql-d/mysql-native/issues/159
1143-
+/
1143+
*/
11441144
version(none)
11451145
debug(MYSQLN_TESTS)
11461146
{

source/mysql/impl/pool.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/++
2+
Implementation - Vibe.d MySQL Pool.
3+
24
Connect to a MySQL/MariaDB database using vibe.d's
35
$(LINK2 http://vibed.org/api/vibe.core.connectionpool/ConnectionPool, ConnectionPool).
46

source/mysql/impl/prepared.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/++
2-
Use a DB via SQL prepared statements.
2+
Implementation - Prepared statements.
33
44
WARNING:
55
This module is used to consolidate the common implementation of the safe and

source/mysql/impl/result.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/++
2-
Structures for data received: rows and result sets (ie, a range of rows).
2+
Implementation - Data result structures.
33
44
WARNING:
55
This module is used to consolidate the common implementation of the safe and

source/mysql/package.d

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ module mysql;
7575
// by default we do the unsafe API.
7676
public import mysql.unsafe;
7777

78+
// import the safe version for generating documentation.
79+
version(MySQLDocs)
80+
{
81+
// also document safe items
82+
import mysql.safe;
83+
84+
// also document forwarding modules
85+
import mysql.commands;
86+
import mysql.result;
87+
import mysql.pool;
88+
import mysql.prepared;
89+
import mysql.connection;
90+
}
91+
7892
debug(MYSQLN_TESTS) version = DoCoreTests;
7993
debug(MYSQLN_CORE_TESTS) version = DoCoreTests;
8094

source/mysql/pool.d

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
/++
2-
This module publicly imports `mysql.unsafe.pool`, which provides backwards
3-
compatible functions for using vibe.d's
4-
$(LINK2 http://vibed.org/api/vibe.core.connectionpool/ConnectionPool, ConnectionPool).
5-
6-
Please see the module documentation in `mysql.impl.pool` for more details.
2+
This module publicly imports `mysql.unsafe.pool`. Please see that module for more documentation.
73
84
In the future, this will migrate to importing `mysql.safe.pool`. In the far
95
future, the unsafe version will be deprecated and removed, and the safe version

source/mysql/result.d

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
/++
2-
This module publicly imports `mysql.unsafe.result`, which provides backwards
3-
compatible structures for processing rows of data from a MySQL server. Please
4-
see that module for details on usage.
5-
6-
It is recommended instead ot import `mysql.safe.result`, which provides
7-
@safe-only mechanisms for processing rows of data.
8-
9-
Note that the actual structs are documented in `mysql.impl.result`.
2+
This module publicly imports `mysql.unsafe.result`. Please see that module for
3+
more documentation.
104
115
In the future, this will migrate to importing `mysql.safe.result`. In the far
126
future, the unsafe version will be deprecated and removed, and the safe version

source/mysql/safe/commands.d

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/++
2+
Use a DB via plain SQL statements (safe version).
3+
24
Commands that are expected to return a result set - queries - have distinctive
35
methods that are enforced. That is it will be an error to call such a method
46
with an SQL command that does not produce a result set. So for commands like

source/mysql/safe/connection.d

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
/++
2-
Connect to a MySQL/MariaDB server.
2+
Connect to a MySQL/MariaDB server (safe version).
33
44
This is the @safe API for the Connection type. It publicly imports `mysql.impl.connection`, and also provides the safe version of the API for preparing statements.
55
6+
Note that the common pieces of the connection are documented and currently
7+
reside in `mysql.impl.connection`. Please see this module for documentation of
8+
the connection object.
9+
610
$(SAFE_MIGRATION)
711
+/
812
module mysql.safe.connection;
@@ -18,9 +22,10 @@ import mysql.safe.commands;
1822
Submit an SQL command to the server to be compiled into a prepared statement.
1923
2024
This will automatically register the prepared statement on the provided connection.
21-
The resulting `mysql.impl.prepared.SafePrepared` can then be used freely on ANY `Connection`,
22-
as it will automatically be registered upon its first use on other connections.
23-
Or, pass it to `Connection.register` if you prefer eager registration.
25+
The resulting `mysql.impl.prepared.SafePrepared` can then be used freely on ANY
26+
`mysql.impl.connection.Connection`, as it will automatically be registered upon
27+
its first use on other connections. Or, pass it to
28+
`mysql.impl.connection.Connection.register` if you prefer eager registration.
2429
2530
Internally, the result of a successful outcome will be a statement handle - an ID -
2631
for the prepared statement, a count of the parameters required for

source/mysql/safe/package.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/++
2-
Imports all of $(LINK2 https://github.com/mysql-d/mysql-native, mysql-native).
2+
Imports all of $(LINK2 https://github.com/mysql-d/mysql-native, mysql-native) (safe versions).
33
44
This module will import all modules that use the safe API of the mysql library.
55
In a future version, this will become the default.

source/mysql/safe/pool.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/++
22
Connect to a MySQL/MariaDB database using vibe.d's
3-
$(LINK2 http://vibed.org/api/vibe.core.connectionpool/ConnectionPool, ConnectionPool).
3+
$(LINK2 http://vibed.org/api/vibe.core.connectionpool/ConnectionPool, ConnectionPool) (safe version).
44
5-
This aliases `mysql.impl.pool.MySQLPoolImpl!true` as MySQLPool. Please see the
6-
`mysql.impl.pool` moddule for documentation on how to use MySQLPool.
5+
This aliases `mysql.impl.pool.MySQLPoolImpl!true` as `MySQLPool`. Please see the
6+
`mysql.impl.pool` moddule for documentation on how to use `MySQLPool`.
77
88
This is the @safe version of mysql's pool module, and as such uses only @safe
99
callback delegates. If you wish to use @system callbacks, import

source/mysql/safe/prepared.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/++
2-
This module publicly imports `mysql.impl.prepared`. See that module for
3-
documentation on using prepared statements with a MySQL server.
2+
This module publicly imports `mysql.impl.prepared` (safe version). See that
3+
module for documentation on using prepared statements with a MySQL server.
44
55
This module also aliases the safe versions of structs to the original struct
66
names to aid in transitioning to using safe code with minimal impact.

source/mysql/safe/result.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/++
2-
This module publicly imports `mysql.impl.result`. See that module for documentation on how to use result and result range structures.
2+
This module publicly imports `mysql.impl.result`. See that module for documentation on how to use result and result range structures (safe versions).
33
44
This module also aliases the safe versions of these structs to the original
55
struct names to aid in transitioning to using safe code with minimal impact.

source/mysql/unsafe/commands.d

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
/++
2-
Use a DB via plain SQL statements.
2+
Use a DB via plain SQL statements (unsafe version).
33
44
Commands that are expected to return a result set - queries - have distinctive
55
methods that are enforced. That is it will be an error to call such a method
66
with an SQL command that does not produce a result set. So for commands like
77
SELECT, use the `query` functions. For other commands, like
88
INSERT/UPDATE/CREATE/etc, use `exec`.
9+
10+
This is the @system version of mysql's command module, and as such uses the @system
11+
rows and result ranges, and the `Variant` type. For the `MySQLVal` safe
12+
version, please import `mysql.safe.commands`.
913
+/
1014

1115
module mysql.unsafe.commands;
@@ -130,6 +134,9 @@ unittest
130134
/++
131135
Execute an SQL command or prepared statement, such as INSERT/UPDATE/CREATE/etc.
132136
137+
Note: The safe `mysql.safe.commands.exec` is also aliased here, so you have access to all
138+
those overloads in addition to these.
139+
133140
This method is intended for commands such as which do not produce a result set
134141
(otherwise, use one of the `query` functions instead.) If the SQL command does
135142
produces a result set (such as SELECT), `mysql.exceptions.MYXResultRecieved`
@@ -171,8 +178,6 @@ auto myInt = 7;
171178
auto rowsAffected = myConnection.exec("INSERT INTO `myTable` (`a`) VALUES (?)", myInt);
172179
---
173180
+/
174-
alias exec = SC.exec;
175-
///ditto
176181
ulong exec(Connection conn, const(char[]) sql, Variant[] args) @system
177182
{
178183
auto prepared = conn.prepare(sql);
@@ -195,6 +200,10 @@ ulong exec(Connection conn, ref BackwardCompatPrepared prepared) @system
195200
return result;
196201
}
197202

203+
//ditto
204+
// Note: doesn't look right in ddox, so I removed this as a ditto.
205+
alias exec = SC.exec;
206+
198207

199208
/++
200209
Execute an SQL SELECT command or prepared statement.

source/mysql/unsafe/connection.d

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
/++
2-
Connect to a MySQL/MariaDB server.
2+
Connect to a MySQL/MariaDB server (unsafe version).
33
4-
This is the unsafe API for the Connection type. It publicly imports `mysql.impl.connection`, and also provides the unsafe version of the API for preparing statements.
4+
This is the unsafe API for the Connection type. It publicly imports
5+
`mysql.impl.connection`, and also provides the unsafe version of the API for
6+
preparing statements. Note that unsafe prepared statements actually use safe
7+
code underneath.
58
6-
Note that unsafe prepared statements are no different from safe prepared statements, except for the mechanism to set parameters allows Variant.
9+
Note that the common pieces of the connection are documented and currently
10+
reside in `mysql.impl.connection`. Please see this module for documentation of
11+
the connection object.
712
813
This module also contains the soon-to-be-deprecated BackwardCompatPrepared type.
914

source/mysql/unsafe/package.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/++
2-
Imports all of $(LINK2 https://github.com/mysql-d/mysql-native, mysql-native).
2+
Imports all of $(LINK2 https://github.com/mysql-d/mysql-native, mysql-native) (unsafe versions).
33
44
This module will import all modules that use the unsafe API of the mysql
55
library. Please import `mysql.safe` for the safe version.

source/mysql/unsafe/pool.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/++
22
Connect to a MySQL/MariaDB database using vibe.d's
3-
$(LINK2 http://vibed.org/api/vibe.core.connectionpool/ConnectionPool, ConnectionPool).
3+
$(LINK2 http://vibed.org/api/vibe.core.connectionpool/ConnectionPool, ConnectionPool) (unsafe version).
44
5-
This aliases `mysql.impl.pool.MySQLPoolImpl!false` as MySQLPool. Please see the
6-
`mysql.impl.pool` moddule for documentation on how to use MySQLPool.
5+
This aliases `mysql.impl.pool.MySQLPoolImpl!false` as `MySQLPool`. Please see the
6+
`mysql.impl.pool` moddule for documentation on how to use `MySQLPool`.
77
88
This is the unsafe version of mysql's pool module, and as such uses only @system
99
callback delegates. If you wish to use @safe callbacks, import

source/mysql/unsafe/prepared.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/++
2-
This module publicly imports `mysql.impl.prepared`. See that module for
3-
documentation on using prepared statements with a MySQL server.
2+
This module publicly imports `mysql.impl.prepared` (unsafe version). See that
3+
module for documentation on using prepared statements with a MySQL server.
44
55
This module also aliases the unsafe versions of structs to the original struct
66
names to aid in backwards compatibility.

source/mysql/unsafe/result.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/++
2-
This module publicly imports `mysql.impl.result`. See that module for documentation on how to use result and result range structures.
2+
This module publicly imports `mysql.impl.result`. See that module for documentation on how to use result and result range structures (unsafe versions).
33
44
This module also aliases the unsafe versions of structs to the original struct
55
names to aid in backwards compatibility.

0 commit comments

Comments
 (0)