Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

PostgreSQL driver for Joomla! platform. #532

Closed
wants to merge 393 commits into from

Conversation

gpongelli
Copy link
Contributor

This driver implements inherited function from JDatabase class and add some other useful function to be able to use Joomla! on PostgreSQL database.
There is also a class that inherits from JDatabaseQuery to be able to create query object using PostgreSQL dialect.
These two classes are tested by other two classes under "test" folder.

PostgreSQL's added functions:

  • dropTable, drops given table
  • getRandom, ge a random number
  • getStringPositionSQL, returns string's position inside another string
  • releaseTransactionSavepoint, release given savepoint during transaction
  • renameTable, rename given table
  • showTables, lists all table in database
  • transactionCommit, commit a transaction
  • transactionRollback, rollback whole transaction or to a savepoint
  • transactionSavepoint, creates transaction savepoint
  • transactionStart, starts a transaction

Overridden functions:

  • connected
  • escape
  • fetchArray
  • fetchAssoc
  • fetchObject
  • freeResult
  • getAffectedRows
  • getAlterDbCharacterSet
  • getCollation
  • getCreateDbQuery
  • getNumRows
  • getQuery
  • getTableColumns
  • getTableCreate
  • getTableKeys
  • getTableList
  • getVersion
  • insertid
  • query
  • replacePrefix
  • select
  • setUTF

PostgreSQL database query added functions:

  • limit, a possible replace for limit in setQuery
  • offset, a possible replace for limit in setQuery
  • forShare, lock table/row during SELECT
  • forUpdate, lock table/row during SELECT
  • getInsertTable, used in "indertid()" to retrieve last INSERT INTO's table name
  • lock, lock given table
  • noWait, no wait a locked table
  • returning, an INSERT INTO optional clause to returns last insert id
  • unlock, unlock tables

@elinw
Copy link
Contributor

elinw commented Nov 14, 2011

Thanks Gabriele!

@Hackwar
Copy link
Member

Hackwar commented Nov 14, 2011

Looks interesting. I didn't check the functionality extensively, but I noticed three things. The first is, that you have a series of deprecated messages, which you marked with 11.3. As I understood it, the deprecation marking means the version where it is removed, which would be the next release in your case. The second thing is, that it seems as if something went wrong while merging in the media package. There are two files with a few strange lines at the top. The last thing is an added jimport for JLog in JRegistry. I learned that recently, too, that JLog does not get a jimport anymore, since it is loaded in the bootstrap of the framework.

@gpongelli
Copy link
Contributor Author

Hi hackwar, I've erroneously marked as 11.3 because I've done a find&replace all 11.1 that I've had inside my code.
I see that my media package has something wrong, but I've never edit there, only merged from master branch, so I don't know how it was appened. Please tell me which are these files so I can edit them.
For the third thing I've not understood what piece of code you're referring to, please let me know.

@Hackwar
Copy link
Member

Hackwar commented Nov 14, 2011

Broken files in media package:
/libraries/joomla/media/image.php
/libraries/joomla/media/imagefilter.php

unnecessary jimport('joomla.log.log'):
/libraries/joomla/registry/format/json.php

@joomla-jenkins
Copy link

Build triggered by changes to the base.

Test log missing. Tests failed to execute.
Checkstyle analysis reported 241 warnings and 468 errors.

@@ -53,6 +53,8 @@ class JRegistryFormatJSON extends JRegistryFormat
$options = array('processSections' => $options);

// Deprecation warning.
jimport('joomla.log.log');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call is not needed because of the autoloader.

@elinw
Copy link
Contributor

elinw commented Nov 15, 2011

Hannes deprecation is the release at which deprecation is announced and is a warning that it will be released in the future. That is how we use it thoughout the platform and the CMS.

We learned a long time ago not to predict when things will actually be removed but instead give a warning that removal is coming.

@gpongelli
Copy link
Contributor Author

Commits added to correct highlighted issues.

@joomla-jenkins
Copy link

Build triggered by changes to the head.

Test log missing. Tests failed to execute.
Checkstyle analysis reported 241 warnings and 468 errors.

@realityking
Copy link
Contributor

@elin didn't we just change it a bit back to say the release win we remove stuff and not the release in which it was first deprecated.

@@ -11,6 +11,8 @@ defined('JPATH_PLATFORM') or die;

jimport('joomla.database.table');

jimport('joomla.database.table');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sams as line 12, please remove.

@realityking
Copy link
Contributor

@gpongelli
When you're trough addressing comments could you rebase this into one commit?

@realityking
Copy link
Contributor

Code Style and unit test report: http://elkuku.github.com/pulltester/pulls/532.html

@elinw
Copy link
Contributor

elinw commented Nov 15, 2011

Those who forget the past are condemned to repeat it.

@gpongelli
Copy link
Contributor Author

@elin it's really strange, I continuously merge postgresql branch with fetched master branch but some of changes on master branch, not related to postgresql, seems to be lost.

@realityking wow, how can I generate this report, so I can correct all once ?
I'm clearing commented code, next I'll commit on my branch. What do you mean with "rebase this" ? "This" what ?

joomla-jenkins said test log missing, which are those files so I can commit them ?

@gpongelli
Copy link
Contributor Author

@ALL I've added some label used inside errorMsg variable, where can I add english translation of these strings ?
an example is postgresql.php, line 71 .
Thank you!

@elinw
Copy link
Contributor

elinw commented Nov 15, 2011

Right now they are still figuring out how to package the strings so in the CMS it will get put into the file what holds all the library strings. Not much else to do about it right now.

@realityking
Copy link
Contributor

For the code style stuff phpcs is used (https://github.com/sebastianbergmann/phpcs-sebastian)

As for rebasing, here's dome documentation on it: http://help.github.com/rebase/ But that should be the last thing to do after all is fixed.

@realityking
Copy link
Contributor

Something went wrong here, this pull contains several commits that are already part of master.

@gpongelli
Copy link
Contributor Author

Whats goes wrong?
Sometimes I merge master into my branch to upgrade my branch with new feature and to not have too many differences between these branches except for postgresql additions.

Eng. Gabriele Pongelli

@realityking
Copy link
Contributor

Did you happen to rebase you branch? that may have gone wrong.

Maybe Ian knows a way to fix this, if he don't I suggest creating a patch from this pull request (https://github.com/joomla/joomla-platform/pull/532.patch), applying that to a fresh branch and making a new pull request from the new branch.

@gpongelli
Copy link
Contributor Author

No, I didn't rebase this branch, I've only merged last master changes in this branch without rebasing it.
I've fixed some errors about deprecated methods not removed.

What error do you receive ?
Is a merge error ?

@gpongelli
Copy link
Contributor Author

waiting #903 and #906 , maybe I'll create another cleaner pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet