Commit Graph

78 Commits

Author SHA1 Message Date
Ashesh Vashi
ca62825c90 Set PGPASSWORD environment variable from the process executor before running
the external utility.
2016-05-15 22:29:17 +05:30
Murtuza Zabuawala
8ca760ee2b Addd support for taking backup for the server.
Tweaked by Ashesh Vashi to integrate the backgroud process, and also
with some improvements as stated below:
* Resolved an issue loading existing preference.
* Improved the background process observer/executor for supporting
  detalied view.
* Added the utility path preferences in the ServerType class.
2016-05-15 16:04:39 +05:30
Harshal Dhumal
14839bf5de Always make sure - we convert the psasword to string in the as_dict
function.
2016-05-14 01:14:26 +05:30
Ashesh Vashi
b22d73ec46 Improvise the pgsql driver to keep the utility names used for different
operation like backup, restore, etc within it.

Also:
* improvised the color combination of the background process logger.
* Removed an unnecessary print statement from the
  get_storage_directory(..) function, also return None if STORAGE_DIR
  is set to None.
2016-05-14 00:48:20 +05:30
Harshal Dhumal
4816f5ed12 Change server password feature 2016-05-13 13:21:20 +05:30
Ashesh Vashi
9cdd1f8098 Added support for the server side file manager, which will be useful in
selection, creation, upload/download files/directories resides on the
server side.

This will be useful for file selection/creation for different server
side utilites like pg_dump, pg_dumpall, pg_restore.
2016-05-13 00:04:32 +05:30
Ashesh Vashi
7f790a7f49 Use the same cursor object of a connection object only from the same
server.

Current implementation keeps the cursor object in the 'g' (current
request context) object identified by the connection-id.
But - it fails to identify a different connection object request, when
we have same database name in different database server, it does not
able to identify it as separate request, Hence - now we will use
server-id qualified identifier for the same object.

Thanks Neel Patel for pointing out the issue.
2016-05-12 13:08:38 +05:30
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