Commit Graph

71 Commits

Author SHA1 Message Date
Ashesh Vashi
9cae686c65 Allow the modules to define the i18n messages, and other messages
required by its javascript module.

This will allow us to load the javascript modules as a static file, and
not as a Jinja2 template. This will increase the load time, as it will
decrease number of templates to be processed during loading those
javascripts.
2016-05-10 16:07:48 +05:30
Ashesh Vashi
e8b4bb909b Do not honour the session-id, longer than 40 characters, instead create
new session-id in that case.
2016-05-09 00:04:37 +05:30
Karen Blatchley
949e536bae First round of string review and cleanup. 2016-05-06 13:53:48 +01:00
Dave Page
0628ee0425 Dashboards v1 2016-05-05 16:42:16 +01:00
Khushboo Vashi
970e0c3540 [Python 3] Fixed an issue iterate the keys from the session loaded from
the sqlite.
2016-04-26 16:16:29 +05:30
Ashesh Vashi
26e9ceaf48 Do not reset the driver registry when the 'load_driver' method of
DriverRegistry is executed second time.

Also, initialize the driver before registering different blueprints,
which uses those driver inside them.

Thanks Khushboo for reporting the issue.
2016-04-25 15:33:54 +05:30
Priyanka Shendge
98d473a7ec Initial version of a regression test framework 2016-04-17 10:39:08 -04:00
Akshay Joshi
03d6fce53c Add support for an affected row count property to the DB interface. 2016-04-12 17:02:54 +01:00
Dave Page
62fcfd928d Add context-sensitive SQL help. 2016-04-12 13:36:06 +01:00
Ashesh Vashi
c304d3e90e Save the database OID of the maintenance database. 2016-04-11 17:15:55 +05:30
Neel Patel
e585ddbdaf Improvise the PostgreSQL driver to fetch the status message.
At the moment, we will only allow to fetch status messages from the
asynchronous connection only, later - we may implement to fetch the
status message from the normal connection too.
2016-04-05 13:29:20 +05:30
Akshay Joshi
5331075ab0 Improvise the psycopg2 wrapped driver for PostgreSQL to show formatted
message on demand.

Also - resolved an issue identifying the aborted transaction while using
the asychronous connection.
2016-04-04 12:29:43 +05:30
Ashesh Vashi
067c269fc8 Convert the value in proper format, as we may only get string values
for integer and numeric type.
2016-03-24 14:29:49 +05:30
Ashesh Vashi
7bce6dd903 The changed value of a multiline/text control was not saved in the
configuration database due to unable to identify the change properly.
Thanks Dave for reporting.

This also includes a support to use a 'text' type of preference, and
show help string next to the control.
2016-03-24 13:00:15 +05:30
Murtuza Zabuawala
12a0cb1ba1 [Python 3] Fixed the issue loading the value for the session key from the sqlite. 2016-03-23 12:40:11 +05:30
Ashesh Vashi
b3c625f135 Graceful server reconnections. 2016-03-22 15:35:11 +00:00
Ashesh Vashi
3c366fafe7 Server side session management support. 2016-03-22 15:05:43 +00:00
Neel Patel
ff424850f8 Fix a bug in the database drive poll() function where we could try to reference a non-existant variable. 2016-03-15 13:01:28 +00:00
Akshay Joshi
f08aa6a313 Always fetch column info from the server, even if there are no rows. 2016-03-08 15:59:53 +00:00
Dave Page
5ea822f33e Preferences dialogue. Patch by Ashesh and Khushboo Vashi. 2016-03-07 11:48:53 +00:00
Neel Patel
31ab9ebacc Using the correct member variable while fetching the notices/messages
from the psycopg2 connection.
2016-03-06 18:56:42 +05:30
Ashesh Vashi
0b43443151 Allow the connection driver to return notices/messages from the server. 2016-03-04 10:35:50 +00:00
Akshay Joshi
e138ec53b6 Add support for asynchronous connections to the database server. 2016-03-02 13:29:15 +00:00
Ashesh Vashi
c3b0e1dec4 Returns an error when the driver couldn't decrypt the password, and
let the user know the issue.
2016-02-22 14:03:07 +05:30
Ashesh Vashi
d5da26876b Resolved few issues (with some improvements) with existing nodes.
This commit takes care of the following issues/improvements.
* Adding missing imports for unauthorised in database module
* Node under Servers Nodes (i.e. Databases, tablespaces, roles nodes)
  need to be inherited from PGChildNodeView (and, not from NodeView) for
  adding server version check for their children.
* Adding statistics for database, and tablespaces in its node (not, yet
  in UI)
* Renaming the camel case methods with proper name.
  (i.e. getSQL -> get_sql, getNewSQL -> get_new_sql, etc.)
* Fixed the functions going beyond the text limit (column: 80) in
  Databases, Roles & Tablespaces modules.
* Fixed the node method of Database module, which was not tested ever.
* We do not need separate SQL template for fetching the name (i.e.
  get_name.sql), using the 'nodes.sql' for the same.
* Optimise the query for fetching ACLs for the database node, we didn't
  require to join certain tables, while fetching only the ACLs.
* Introduced the list of the ACLs (regular and default ACLs for
  different type) supported by each version [Databases Module].
* Renamed the templates 'get_nodes.sql' to' nodes.sql' to make it
  consistent with other modules.
* Removed the checks for the authentication table use, as we don't need
  to expose the password to the users (even the encrypted MD5). Using
  the pg_roles view always for fetching roles/users information now.
* Resolved some typos in unreachable (specially the exceptions
  catchment area.)
* Logging the exception in the application.
* Using qtLiteral, qtIdent properly in the templates (do not assume
  about the types of data.)
* Using tsid as identifier instead of did for the tablespaces.
* Using nodes method of tablespace view for fetching individual node
  information.
* Removing the hardcoded node information from the 'parse_priv_to_db'
  function, and pass on allowed ACLs by the caller nodes.
* Using 'nodes.sql' to fetch name of the template instead of writing
  that in the delete.sql template, which is definitely wrong place to
  fetch the name of the object. [Tablespace Module]
2016-02-22 11:44:24 +05:30
Ashesh Vashi
639a3ed0ac Fixes the qtIdent function in the psycopg2 driver about not taking care
of double quote within it.

The 'replace' function of immutable type string do create a new
instance of type string, which needed to be reassgined to the variable
'value'.

Reported By: Murtuza Zabuawala
2016-02-10 15:00:52 +05:30
Akshay Joshi
86115cff6c Adding support to serialize the datetime to the JSON object properly. 2016-02-05 14:18:35 +05:30
Ashesh Vashi
3ca29b18b5 Resolved an issue related to quoting the wrong keywords for the types.
It was due to wrong index used for the COL_NAME_KEYWORD, used by the
'needsQuoting' function.

Also, replaced a tab with a space in the generate_keyword.py file.

Reported by: Sanket Mehta, Khushboo Vashi
2016-02-05 10:15:23 +05:30
Harshal Dhumal
b77c5a6c54 Python 2.6 support fixes. 2016-01-27 15:59:54 +01:00
Sanket Mehta
0eadd92a7f Fetch the last system oid for the database connection too. 2016-01-22 10:38:02 +05:30
Ashesh Vashi
0a21beca17 Resolved a typo in the psycopg2 driver, qtTypeIdent checking the wrong
list, because - in specific type match comma (,) was missing.
2016-01-21 16:54:40 +05:30
Dave Page
694506453b Copyright updates for 2016. 2016-01-18 14:48:14 +00:00
Ashesh Vashi
f8fd93c207 Update the user and datbaase information everytime, we connect the
server. And, delete them as soon as all connections are released.
2016-01-12 01:06:56 +05:30
Ashesh Vashi
932ed358e8 Adding the current user information in the server information (when
connected).
2016-01-11 22:11:10 +05:30
Ashesh Vashi
d2897a334f Using simplejson for jsonify the data of type Decimal, which will used
for numeric type of PostgreSQL, in python using psycopg2.
2016-01-09 18:05:18 +05:30
Murtuza Zabuawala
b1dbcd0932 [Python 3 compatibility] 'qtLiteral' functions needs to return data in
unicode.
2016-01-07 19:33:51 +05:30
Ashesh Vashi
5e67ca959d JSONinfy all data in new mode for the Backbone.Model.
Also, takes care about not quoting the identifier, when found any digit
in the name (except it starts with a digit).
2016-01-07 09:40:45 +05:30
Ashesh Vashi
a086820288 Allow to pass array as an input to the qtIdent. 2016-01-07 08:38:55 +05:30
Ashesh Vashi
fc9f94c1d0 Return the tuple (status, message) from the psycopg2 driver instead of
returning the response itself.
2016-01-04 21:59:24 +05:30
Murtuza Zabuawala
b309b1ffb8 [Python 3 compability] decode function used in 'needsQuoting' function
is not available on Python 3.
2016-01-04 17:09:15 +05:30
Ashesh Vashi
7358549524 Allow to specify the number of arguments in the qtTypeIdent to make it work
with schema specified object name.

You can use the qtTypeIdent template filter as:
conn|qtTypeIdent(name)
or,
conn|qtTypeIdent(schema_name, name)
2016-01-04 13:41:57 +05:30
Ashesh Vashi
1ba5d79978 Allow to specify the number of arguments in the qtIdent to make it work
with schema specified object name. This will also works with
EntepriseDB's package too.

Also, added dependency on the current connection object, it will allow
us to use the keywords list specific to the database server in futuer.

You can use the qtIdent template filter as:
conn|qtIdent(name)
or,
conn|qtIdent(schema_name, name)
2016-01-04 13:13:46 +05:30
Ashesh Vashi
49373df02d Resolved issues regarding the rows, and column description not return by
the given query in the execute_dict and execute_2darray function in the
psycopg2 driver.
2016-01-04 12:11:52 +05:30
Murtuza Zabuawala
574105ce5e Resolved an issue related to logging the error message.
Also, fetch the datlastsysoid when making the connection.
2016-01-04 11:18:04 +05:30
Ashesh Vashi
ef3f54378c Introduced an ajax response 'not_implemented' with HTTP status code 501. 2016-01-02 14:55:13 +05:30
Ashesh Vashi
2aeae06882 Added support for qtIdent, qtTypeIdent, qtLiteral for quoting the
inputs.

In order to do the proper quoting around the identifier, different type,
and literal, we introduced respective functions qtIdent, qtTypeIdent,
qtLiteral in psycopg2 driver. Also, introduced them as the Jinja's
custom filter for using it directly inside the templates.

Also, created an utility - generate_keywords.py in order to generate
keyword lists from the latest PostgreSQL installation.
2016-01-02 14:54:05 +05:30
Ashesh Vashi
d891a9d4d7 Log the executing SQL stataments and error propertly from the psycopg2 driver 2015-12-16 13:34:12 +05:30
Ashesh Vashi
537df154fe Fixing few issues with context menu icon missing.
Introduced a new ajax function to return the HTTP Status code 410 (GONE).
Changed the location of the javascript from each modules, it loads.

Added .swp, .swo files in the .gitignore file
2015-12-04 14:47:18 +05:30
Ashesh Vashi
9bc9025075 Issues resolved related to connection management and collection nodes:
- Allow to release connection using the database OID (did).
- Generate correct url for the collection nodes.
- Removed the server-type from the collection node module, from the
  generate_browser_collection_node(...) function.
- Show version string, and not version integer in the server properties
  (when connected).
2015-11-20 14:55:55 +05:30
Ashesh Vashi
77834ccdda Changed the logic to identify the PostgreSQL server variant, when we
connect to the database server. Also, added modified the way, we do
check the node is supported by the server.

Instead of creating separate blueprint for the server types, they will
be independently works. In order to add different variant of the
PostgreSQL, we need to extend the ServerType class, and override the
'instanceOf' function for identification using version string. Please
take a look at the ppas.py for the example.

During checking the back-end support for the node, we will also check
the server type (variant) along with the version within the range of
maximum and minimum version for the node. And, the same support added
for the schema attributes in front-end (JavaScript).

Really thankful to Khushboo Vashi for her initial work in front-end. I
took it further from there.
2015-11-19 23:18:00 +05:30