Skip to content

Commit a632a83

Browse files
committed
BUG#25687226 BUG#28576667 Misc API Help Updates
BUG#25687226 CANNOT FIND GLOBAL SESSION DOCUMENTATION IN SHELL JS API REFERENCE MANUAL The documentation was updated as follows: - The db object description was fixed to indicate it is available only on sessions with the X protocol. The db object now properly links the Schema help page. - An annotation was added for the session object, including links to the Session and ClassicSession objects as well as a link to shell.connect where the global session can be established. BUG#28576667 SHELL MYSQL MODULE (CLASSICSESSION) API DOCUMENTATION OUTDATED The class had a hardcoded JavaScript example for both Python and JavaScript documentation that was using methods that no longer exist. This was fixed by replacing the hardcoded example with snippets taken from the Unit Tests for the corresponding language. Change-Id: I7324a2373ed5bef14e46153897120aadc88733c0
1 parent d533e0a commit a632a83

20 files changed

+513
-276
lines changed

doc/apis/DoxygenLayout.scripting.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<tab type="filelist" visible="yes" title="" intro=""/>
2020
<tab type="globals" visible="yes" title="" intro=""/>
2121
</tab>
22-
<tab type="examples" visible="yes" title="" intro=""/>
22+
<tab type="examples" visible="no" title="" intro=""/>
2323
</navindex>
2424

2525
<!-- Layout definition for a class page -->

doc/apis/connection_data.dox

+1-26
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,7 @@ On the API exposed on the MySQL Shell, several functions require some connection
2929

3030
\copydoc connection_options
3131

32-
$(TOPIC_CONNECTION_OPTION_SCHEME)
33-
34-
$(TOPIC_CONNECTION_OPTION_SCHEME1)
35-
36-
$(TOPIC_CONNECTION_OPTION_SCHEME2)
37-
38-
$(TOPIC_CONNECTION_OPTION_SCHEME3)
39-
40-
$(TOPIC_CONNECTION_OPTION_SOCKET)
41-
42-
$(TOPIC_CONNECTION_OPTION_SOCKET1)
43-
44-
$(TOPIC_CONNECTION_OPTION_SOCKET2)
45-
46-
$(TOPIC_CONNECTION_OPTION_SOCKET3)
47-
$(TOPIC_CONNECTION_OPTION_SOCKET_UNIX)
48-
$(TOPIC_CONNECTION_OPTION_SOCKET_UNIX1)
49-
$(TOPIC_CONNECTION_OPTION_SOCKET_UNIX2)
50-
$(TOPIC_CONNECTION_OPTION_SOCKET_UNIX3)
51-
$(TOPIC_CONNECTION_OPTION_SOCKET_UNIX4)
52-
$(TOPIC_CONNECTION_OPTION_SOCKET_UNIX5)
53-
54-
@note On Windows, socket needs to be prepended with <b>@\\\\.\\</b>:
55-
$(TOPIC_CONNECTION_OPTION_SOCKET_WIN)
56-
$(TOPIC_CONNECTION_OPTION_SOCKET_WIN1)
57-
@par
32+
$(TOPIC_CONNECTION_TYPES)
5833

5934
$(TOPIC_CONNECTION_OPTION_SSL_MODE)
6035

doc/apis/doxygen.cfg.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ DOXYFILE_ENCODING = UTF-8
5454
# title of most generated pages and in a few other places.
5555
# The default value is: My Project.
5656

57-
PROJECT_NAME = "MySQL Shell"
57+
PROJECT_NAME = "MySQL Shell API"
5858

5959
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
6060
# could be handy for archiving the generated documentation or if some version

doc/apis/main.dox

+5-2
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@ The functionality of the APIs is exposed through modules and global objects whic
2727
- The \ref mysql module contains a lightweight development API to interact with MySQL Servers using a classic session.
2828
- The <a class ="el" href="classmysqlsh_1_1dba_1_1_dba.html">dba</a> global object enables you to administer InnoDB clusters using the AdminAPI.
2929
- The <a class ="el" href="classmysqlsh_1_1_shell.html">shell</a> global object gives access to general purpose functions and properties.
30-
- The <b>session</b> global object is available when a global session is established.
31-
- The <b>db</b> global object is available when the global session is established using a default database.
30+
- The <b>session</b><sup>1</sup> global object is available when a global session is established.
31+
- The <a class ="el" href="classmysqlsh_1_1mysqlx_1_1_schema.html">db</a> global object is available when the global session is established through the X protocol using a default database.
3232
- The \ref util global object that groups miscellaneous tools like upgrade checker and JSON import.
3333
\if DOXYGEN_JS
3434
- The <a class ="el" href="classmysqlsh_1_1_sys.html">sys</a> global object gives access to system specific parameters.
3535
\endif
3636

37+
<sup>1</sup> The <b>session</b> global object might be either a <a class ="el" href="classmysqlsh_1_1mysql_1_1_classic_session.html">ClassicSession</a> or a <a class ="el" href="classmysqlsh_1_1mysqlx_1_1_session.html">Session</a> object depending on whether the global session was established using classic MySQL protocol or X protocol respectively.
38+
For additional details look at the connect function in the <a class ="el" href="classmysqlsh_1_1_shell.html">shell</a> object.
39+
3740
For more information on the functionality these APIs provide see the following documentation:
3841

3942
- The <a class ="el" href="http://dev.mysql.com/doc/refman/5.7/en/document-store.html">Using MySQL as a Document Store</a> documentation explains how to use X DevAPI to achieve a NoSQL-like MySQL database.

doc/apis/parameter_binding.dox

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ Available on SQL strings, allows removing values from expression through the use
1212

1313
\if DOXYGEN_JS
1414
\code{.js}
15-
nodeSession = mysqlx.getNodeSession('mike:s3cr3t!@localhost:33060')
15+
session = mysqlx.getSession('mike:s3cr3t!@localhost:33060')
1616

1717
# Loads the adult customers whose name starts with S
18-
result = nodeSession.sql('select * from test.customers where name like ? and age < ?').bind('S%').bind(18).execute()
18+
result = session.sql('select * from test.customers where name like ? and age < ?').bind('S%').bind(18).execute()
1919

2020
The bind function must be called for each place holder on the expression, otherwise an error will occur.
2121
\endcode
2222
\elseif DOXYGEN_PY
2323
\code{.py}
24-
nodeSession = mysqlx.get_node_session('mike:s3cr3t!@localhost:33060')
24+
session = mysqlx.get_session('mike:s3cr3t!@localhost:33060')
2525

2626
# Loads the adult customers whose name starts with S
27-
result = nodeSession.sql('select * from test.customers where name like ? and age < ?').bind('S%').bind(18).execute()
27+
result = session.sql('select * from test.customers where name like ? and age < ?').bind('S%').bind(18).execute()
2828

2929
The bind function must be called for each place holder on the expression, otherwise an error will occur.
3030
\endcode

modules/mod_mysql_session.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ REGISTER_HELP(CLASSICSESSION_GLOBAL_BRIEF,
5656
REGISTER_HELP(CLASSICSESSION_BRIEF,
5757
"Enables interaction with a MySQL Server "
5858
"using the MySQL Protocol.");
59-
REGISTER_HELP(CLASSICSESSION_DETAIL,
60-
"Provides facilities to execute queries "
61-
"and retrieve database objects.");
59+
REGISTER_HELP(CLASSICSESSION_DETAIL, "Provides facilities to execute queries.");
6260
ClassicSession::ClassicSession() { init(); }
6361

6462
ClassicSession::ClassicSession(const ClassicSession &session)

modules/mod_mysql_session.h

+11-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program is free software; you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License, version 2.0,
@@ -54,22 +54,17 @@ class Connection;
5454
* $(CLASSICSESSION_BRIEF)
5555
*
5656
* $(CLASSICSESSION_DETAIL)
57-
*
58-
* \code{.js}
59-
* // Establishes the connection.
60-
* var mysql = require('mysql');
61-
* var session = mysql.getClassicSession("myuser@localhost", pwd);
62-
*
63-
* // Getting a schema through the getSchema function
64-
* var schema = session.getSchema("sakila");
65-
*
66-
* // Getting a schema through a session property
67-
* var schema = session.sakila;
68-
* \endcode
69-
*
70-
* \sa mysql.getClassicSession(String connectionData, String password)
71-
* \sa mysql.getClassicSession(Map connectionData, String password)
7257
*/
58+
#if DOXYGEN_JS
59+
/**
60+
* \snippet mysql_session.js ClassicSession: SQL execution example
61+
*/
62+
#elif DOXYGEN_PY
63+
/**
64+
* \snippet mysql_session.py ClassicSession: SQL execution example
65+
*/
66+
#endif
67+
7368
class SHCORE_PUBLIC ClassicSession
7469
: public ShellBaseSession,
7570
public std::enable_shared_from_this<ClassicSession> {

0 commit comments

Comments
 (0)