-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SAP Adaptive Server Enterprise database vendor #2347
Conversation
I see there are problems with the DateTime conversion on travis now. I will fix them soon. |
Guessing this is still very much work in progress. A few advice's: Ping us when you have something ready and again i have no idea if this have a chance to get merged anytime soon if ever. |
Hi @kimhemsoe, first of all thanks for your response. I will adopt your suggestions step by step. So what i am now doing is to extract changes that are sensible even without the ASE driver to seperate Pull Requests. This has some advantages:
I will reference the pull requests i open up in this PR. I hope this approach is ok for you as well. |
yes that is ok with me. |
efaed6c
to
72478b1
Compare
@kimhemsoe @Ocramius This PR is now a bit more polished. It is now based on all the PR's i have separated from this PR so that diffs that are caused by the other PR's should disappear step by step if the other PR's are getting merged. In now only adds the commit 72478b1 on top of the other PR's and as you can see, this commit does not touches the tests (with tree execptions) anymore. I still will add some more tests to the functionality of the ASE driver and add the alterTable method in the platform. But till this any feedback on the other PR's and of cause this one is welcome. |
Year! At least the tests are not failing anymore! |
Hello, Deltachaos! It's my first time on GitHub, sincerely. How can I do? |
Hi @gnascimento Nice to hear that you are interested in working with this driver. First of all you should force composer to use the correct doctrine packages. We are using this composer.json to do it: {
"require": {
"doctrine/orm": "dev-ase-support as 2.4.0-dev",
"doctrine/dbal": "dev-add-ase-platform as 2.5.0-dev",
"doctrine/doctrine-bundle": "dev-ase as 1.4.0-dev"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Deltachaos/dbal.git"
},
{
"type": "vcs",
"url": "https://github.com/Deltachaos/DoctrineBundle.git"
},
{
"type": "vcs",
"url": "https://github.com/Deltachaos/doctrine2.git"
}
]
} The branches i have specified here are based on a stable doctrine version. This PR is based on the latest master of doctrine. doctrine:
dbal:
driver: ase
host: name-specified-in-interfaces-file
dbname: dbname
user: dbuser
password: dbpassword Please note that the driver is currently based on http://php.net/manual/en/book.sybase.php. Therefore, you should have a working installation of this extension on your server. It requires to have proper I started to create a driver using http://php.net/manual/de/ref.pdo-dblib.php but was not able to create a test server yet. If you would like to test it you can configure it like this: doctrine:
dbal:
driver: pdo_ase
host: server-address
dbname: dbname
user: dbuser
password: dbpassword But it will probably not work. If you have issues with this you can try to fix them in these classes Please note: Doctrine DBAL is split into two parts.
The driver and platform were currently only tested on a Solaris 11 zone. As soon as you have configured doctrine to work with this driver you can work with doctrine like with any other driver that doctrine supports. One thing that is currently not supported is the Symfony I hope I could help you with my explanations. If you have any further questions don't be afraid to ask me in this PR or my mail. You find my E-Mail address on my profile. Of course I would love to see your contributions to this implementation. A good starting point to see the discussion about this driver here in the doctrine project is probably by having a look into my PR's: If you have contributions please send me PR's to the following repositories:
|
Hello I am working with Sybase and i want use Symfony. There is not an installation video that can help us with the tasks |
@klauUs if you want i can help you to get this running. Just contact me at mr@deltachaos.de |
6ae5231
to
d4440be
Compare
d4440be
to
fb3506d
Compare
@klauUs @gnascimento I have moved the code to a separate package so that you can use it without using my (currently outdated) branch of doctrine/dbal. Have published the package xtain/dbal-platform-ase. You then can configure it using a custom driver class and choose between |
This PR adds the driver and DBAL for SAP Sybase Adaptive Server Enterprise databases. It distinguishes between versions 12.5 and below (base
ASEPlatform
), 15.0 (ASE150Platform
), 15.5 (ASE155Platform
), 15.7 (ASE157Platform
), and 16.0 (ASE160Platform
), similar to Microsoft SQL Server.Because Microsoft SQL Server originally where the same product and then later have diverged i have oriented myself at the Microsoft SQL Server platform. A bit of the code could be copied over one by one, some other is only slightly different and even other is completely different.
The differences are most in the system tables, the basic SQL syntax is the same.
I had to move the conversion for date and time into the platform as well because in Sybase ASE the dates have the same string length every time. For example the date
Jan 1 2012
andJan 10 2012
. Both have the same length, for the date with the one digit day there is a space in front (GitHub trim's multiple spaces here). This is something where we are not able to represent such a logic only with the PHP date format methods anymore. We need advanced logic to add this additional space if needed.Another problem with the date and time handling is that the
sybase_ct
driver only returns dates and times with the precision of minutes and not with seconds (even if ASE can store date times up to milliseconds precision).The tests are not able to handle this as well. Therefore, i have adjusted them to handle this case correctly.
Currently only a driver for the
sybase_ct
extension is implemented. There is a PDO driver DBLib available that is currently already used by thePDOSqlsrv
as well. This PDO driver can also be used to connect to a ASE server.There are currently some TODO's on my list:
getAlterTableSQL
method in the platformThere are two other PR's related to this PR in other doctrine packages:
I hope this addition is appreciated and any feedback/help on the above issues would be welcomed.