ZConnection - force a complete reload of database libraries

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 766
Joined: 18.11.2018, 17:37
Location: Hungary

Re: ZConnection - force a complete reload of database libraries

Post by aehimself »

marsupilami wrote:I added your latest files. I hope, these contain all relevant changes? Could you please check that?
Yes, they all seem to be properly imported to testing-7.3. Even the .ToString is now IntToStr so we should be D7-compatible again :)
Edit: The modification of src/dbc/ZDbcIntfs.pas was missed in both testing-7.3 and testing-7.3-aehimself. This way the package did not even compile as .AbortOperation is missing from IZConnection!
marsupilami wrote:We could add a separate connection level parameter to disable that exception on any chosen dblib connection?
We could put an exception handler to the fetching method to silently discard any exceptions raised by cancelling, I just don't know if already fetched records will remain or thrown away by the library... I have to doublecheck that.
marsupilami wrote:I currently try to crate a repository on github - and also on sourceforge. Unfortunately the caveats section of the git-svn manual suggests to keep them read only. So I don't know if they will be of any use. :(
marsupilami wrote:So - as a test case I created two repositories that both seem to be a good copy ot the current Zeos repository:
https://sourceforge.net/u/marsupilami79/zeos/
https://github.com/marsupilami79/zeoslib

I assume, changes still have to be made against the original Zeos SVN repository. We will see, if these repositories can be of any help in terms of patches and pull requests and the like.
I found git-svn and managed to clone Zeos to myself. Unfortunately my knowledge is extremely limited and have no idea how to "convert" it to a real Git repository so I can change branches, post changes, etc.
I'm really happy to hear about the (un)official Zeos Git repository! Do you guys plan to use that one in the future too? It would be a lot more easy (at least for me) to post patches there instead of bridging with git-svn!
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
Fr0sT
Zeos Dev Team
Zeos Dev Team
Posts: 280
Joined: 08.05.2014, 12:08

Re: ZConnection - force a complete reload of database libraries

Post by Fr0sT »

I personally is a total gitter and find SVN awkward compared to it :). But other guys might be more familiar with SVN.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: ZConnection - force a complete reload of database libraries

Post by marsupilami »

aehimself wrote:
marsupilami wrote:I added your latest files. I hope, these contain all relevant changes? Could you please check that?
Yes, they all seem to be properly imported to testing-7.3. Even the .ToString is now IntToStr so we should be D7-compatible again :)
That's good.
aehimself wrote:Edit: The modification of src/dbc/ZDbcIntfs.pas was missed in both testing-7.3 and testing-7.3-aehimself. This way the package did not even compile as .AbortOperation is missing from IZConnection!
I will see what I can do. I did see your pull requests.
aehimself wrote:
marsupilami wrote:We could add a separate connection level parameter to disable that exception on any chosen dblib connection?
We could put an exception handler to the fetching method to silently discard any exceptions raised by cancelling, I just don't know if already fetched records will remain or thrown away by the library... I have to doublecheck that.
Hmmm - maybe we should discuss this in a matter of working code ;)
aehimself wrote:I found git-svn and managed to clone Zeos to myself. Unfortunately my knowledge is extremely limited and have no idea how to "convert" it to a real Git repository so I can change branches, post changes, etc.
As far as I understand git-svn, it is a real Git repository. I don't know if that is the default for git, but it only downloads the master branch (trunk in an SVN repository). I managed to download testing-7.3 by using the switch/checkout menu entry of TortoiseGit. As far as I understand this mirrors the testing-7.3 branch into a local branch. Other branches are available too as "remotes/origin/6.6-patches", "remotes/origin/7.2-patches" etc. As far as I understand the manual of git-svn, one should adhere to some rules:
  • "it is advised that users keep history as linear as possible inside Git to ease compatibility with SVN" -> It is recommended to not create branches, that are not part of SVN. Just do it the svn way - modify a branch and commit your work. Merge between branches that exist in SVN.
  • "it is recommended that all git svn users clone, fetch and dcommit directly from the SVN server[...] The recommended method of exchanging code between Git branches and users is git format-patch and git am, or just 'dcommit’ing to the SVN repository." -> It seems to be a bad idea to accept your pull request. We will need to exchange patch files. As fr0st said - these most probably also can be applied to the SVN repository.
aehimself wrote:I'm really happy to hear about the (un)official Zeos Git repository! Do you guys plan to use that one in the future too? It would be a lot more easy (at least for me) to post patches there instead of bridging with git-svn!
We will not change for the forseeable future. This is more or less my first venture into git. I try to find ways to integrate git users while still being able to keep subversion as the central repository.
Fr0sT
Zeos Dev Team
Zeos Dev Team
Posts: 280
Joined: 08.05.2014, 12:08

Re: ZConnection - force a complete reload of database libraries

Post by Fr0sT »

As a side note, I couldn't manage to make git-svn work so I had to use SmartGit. It has UI somewhat differing from Tortoise and I still find it inconvenient for everyday work. So my workflow is:
- sync Zeos SVN repo into local Git repo with SmartGit
- make changes in local repo and commit them with TortoiseGit
- when a change is complete, prepare patch files
- apply them on pure SVN copy of Zeos with TortoiseSVN
- commit
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 766
Joined: 18.11.2018, 17:37
Location: Hungary

Re: ZConnection - force a complete reload of database libraries

Post by aehimself »

Fr0sT wrote:As a side note, I couldn't manage to make git-svn work so I had to use SmartGit. It has UI somewhat differing from Tortoise and I still find it inconvenient for everyday work. So my workflow is:
- sync Zeos SVN repo into local Git repo with SmartGit
- make changes in local repo and commit them with TortoiseGit
- when a change is complete, prepare patch files
- apply them on pure SVN copy of Zeos with TortoiseSVN
- commit
Is there any other 3rd party tool what you can insert into this chain? :D It seems way to simple until now :D
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
Fr0sT
Zeos Dev Team
Zeos Dev Team
Posts: 280
Joined: 08.05.2014, 12:08

Re: ZConnection - force a complete reload of database libraries

Post by Fr0sT »

:D
Actually I was already using TGit for my projects and SmartGit for getting SVN repos. I just added TSVN for native SVN support (and it works flawlessly with TGit-generated patches, even better than TGit itself!). Anyway my changes were not too extensive so I was comfortable with described chain. Of course for massive commitings I'd try to make a friendship with SmartGit
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: ZConnection - force a complete reload of database libraries

Post by marsupilami »

On the downside: git-svn didn't do what I wanted it to do. Everybody now can see that on trunk. *sigh* I will have to retest that.

Un the upside: I got a kind of a workflow. Don't know how that will work out. Github can generate a diff for a pull request. See here. Until now TortoiseSVN had no problems applying these patches. If that works out, I can apply pull requests to the Zeos SVN repository and have them reapplied to the github repository by pushing them from a locally generated git repository.

@aehimself - could you check how easy it is for you to update your git repository? Usually I would expect git to find out for himself that my changes are changes that you already did? Note: I applied your changes to the testing-7.3-aehimself branch and merged them to 7.3 then.
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 766
Joined: 18.11.2018, 17:37
Location: Hungary

Re: ZConnection - force a complete reload of database libraries

Post by aehimself »

marsupilami wrote:@aehimself - could you check how easy it is for you to update your git repository? Usually I would expect git to find out for himself that my changes are changes that you already did?
Refreshing my git version with yours? Easy.

(need to do once)
1, git remote add upstream https://github.com/marsupilami79/zeoslib.git
2, git fetch upstream

Download updates:
1, git checkout origin/master
2, git rebase upstream/master

About Git realizing new updates - yes and no. By itself no, but most of the clients (like my fav. VS Code) has an autofetch feature, but this requires one common origin... like me pushing my changes to your repository directly, not to my fork and then issuing a pull request.

I'll wait until there will be a new commit in your repo so I can confirm the syncing process.
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 766
Joined: 18.11.2018, 17:37
Location: Hungary

Re: ZConnection - force a complete reload of database libraries

Post by aehimself »

So maybe it works, maybe it does not, but it does something :)
I find it a bit more safe not to add the "upstream" repository (to avoid accidental commits) and fortunately there is a way:

https://help.github.com/en/github/colla ... -your-fork

Now my Git log shows the merge:
Gitlog.PNG
As these two are the same, after pushing it to the merge will disappear, but my repo still says 1 commit ahead, 1 commit behind of yours...

Anyway, it seems to be working, so :)
You do not have the required permissions to view the files attached to this post.
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 766
Joined: 18.11.2018, 17:37
Location: Hungary

Re: ZConnection - force a complete reload of database libraries

Post by aehimself »

So I played around a little bit with an automatic syncing and I messed up my repository so much I had to recreate it. I lost the test app in the process, but I still could copy the code from the cancelled pull request so all is fine :)

I came up with a small batch file which will (should :D ) sync all changes in Jan's repository to the local one in all branches which was already checked out at least once. Just edit it before using and set the variables:

SET ZEOSGIT=C:\LocalWork\zeoslib
SET GITEXE=C:\Program Files\Git\cmd\git.exe
SET ZEOSGITREPO=https://github.com/marsupilami79/zeoslib.git


Sorry Linux folks, this is only for Windows :(
Refresh Zeos Git.7z
You do not have the required permissions to view the files attached to this post.
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: ZConnection - force a complete reload of database libraries

Post by marsupilami »

Ok - so I suggest the following workflow:
  • You create a separate branch in your repository for the things you want to change
  • You merge anything you want to commit to the 7.3 branch - or any other branch where you want to commit and create a pull request
  • I patch that pull request into the Zeos SVN.
  • All changes on the Zeos SVN repository, including your changes, will be pushed to the github repository by me.
Does that make any sense?
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 766
Joined: 18.11.2018, 17:37
Location: Hungary

Re: ZConnection - force a complete reload of database libraries

Post by aehimself »

Sure thing! I guess I'll keep using testing-7.3-aehimself, will just cherry pick things back to testing-7.3 and only send pull requests on that branch. I hope these extra things are not a huge hassle though, I kinda feel like a special snowflake who requires special treatment :S

Btw - is the branch 7.2-patches up to date? I can not compile it because .UpdatePAnsiChar is used incorrectly in ZDbcSqLiteMetadata.pas. I already fixed it locally, can create a pull request for it if needed.
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: ZConnection - force a complete reload of database libraries

Post by marsupilami »

aehimself wrote:Sure thing! I guess I'll keep using testing-7.3-aehimself, will just cherry pick things back to testing-7.3 and only send pull requests on that branch.
Sounds good to me.
aehimself wrote:I hope these extra things are not a huge hassle though, I kinda feel like a special snowflake who requires special treatment :S
Anything to satisfy new developers ;) Honestly you are not the first to ask about git. Maybe it can help in attracting new developers...
aehimself wrote:Btw - is the branch 7.2-patches up to date? I can not compile it because .UpdatePAnsiChar is used incorrectly in ZDbcSqLiteMetadata.pas. I already fixed it locally, can create a pull request for it if needed.
Zeos 7.2 should be current. The automated build system is down curently. So this might have gone unnoticed. Please create a pull request.
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 766
Joined: 18.11.2018, 17:37
Location: Hungary

Re: ZConnection - force a complete reload of database libraries

Post by aehimself »

marsupilami wrote:Anything to satisfy new developers ;) Honestly you are not the first to ask about git.
Does it mean you already consider me as a contributor for Zeos? :) Would be an honor, as I started using this suite back in the 6.6 days. Feels good to finally give something back :)
marsupilami wrote:Maybe it can help in attracting new developers...
I have a server running 24/7 anyways; if you'd like we can try to set up an hourly task to pull the changes from SourceForge to GitHub. Guess whatever you are doing manually can be automated and it might take some load off you.
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: ZConnection - force a complete reload of database libraries

Post by marsupilami »

aehimself wrote:Does it mean you already consider me as a contributor for Zeos? :) Would be an honor, as I started using this suite back in the 6.6 days. Feels good to finally give something back :)
You are contributing code so you are a contributor ;) And I guess at some time we will have to make the change from Subversion to some distributed version control. And git seems to be as good as any other system.
aehimself wrote:I have a server running 24/7 anyways; if you'd like we can try to set up an hourly task to pull the changes from SourceForge to GitHub. Guess whatever you are doing manually can be automated and it might take some load off you.
Automating these things is not the big problem. Currently it looks something like this:

Code: Select all

jan@zeos:~/git$ svnsync sync file:///home/jan/git/zeos-svn
jan@zeos:~/git$ svn-all-fast-export --rules zeos-rules zeos-svn
jan@zeos:~/git$ cd zeos-git/
jan@zeos:~/git/zeos-git$ git push github --all
[output here]
jan@zeos:~/git/zeos-git$ git push sourceforge --all
Having a small bash script execute these commands once per hour is no problem. The problem is that I have no clue (yet) on how to store the necessary credentials with git since it seems that I canot provide them on the command line. Also knowing what happens is a problem. Until now everything worked as expectd. But today I got the following messages while exporting from the local SVN copy to the local GIT repository (svn-all-fast-export):
svn-all-fast-export wrote:Exporting revision 6123 ..."WARN: repository zeos-git branch master has some files copied from testing-7.3@6122"
adding "testing-7.3@6122" : 6042 as a merge point
.."WARN: repository zeos-git branch master has some files copied from testing-7.3@6122"
merge point already recorded
................................ 37 modifications from SVN /trunk/ to zeos-git/master done
I am not sure wether that is something to be concerned about or not yet...
So - I want to think about some kind of a fault detection system, that makes sure, that the source is the same on all branches in SVN and in GIT...
Post Reply