Recent

Author Topic: Postgres, ZEOS and Visual PlanIt - unable to create a table  (Read 2623 times)

kkuba

  • New Member
  • *
  • Posts: 47
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #15 on: April 18, 2022, 01:29:12 pm »
@paweld You did not understand me. I do not transfer the project to CT, but I do not want to enter the trunk version with a large project because of a minor problem. And updating components not via OPM is very problematic when you need to have multiple Lazarus installations. You then need to write an manual on how to configure the IDE for the project to be compiled successfully.
The problem with TMS, on the other hand, is that they only sell components in packages and it is very expensive.
But thanks again for your help - now it works!  :D

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #16 on: April 18, 2022, 06:51:40 pm »
@wp: attached modified version of VpZeosDs.pas taking into account setting the structure depending on RDBMS, for now only sqlite, mysql, pstgres and mssql
Committed with minor modifications.

kkuba

  • New Member
  • *
  • Posts: 47
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #17 on: April 18, 2022, 09:04:37 pm »
@wp Then I am attaching the .po file for the Polish language. Maybe it is worth reporting the whole package to OPM as a new version?

paweld

  • Hero Member
  • *****
  • Posts: 996
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #18 on: April 18, 2022, 09:30:01 pm »
@wp: thank you very much.
Best regards / Pozdrawiam
paweld

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #19 on: April 18, 2022, 11:45:22 pm »
I extended the sample in folder examples/datastores/zeos to show application of a firebird v3 database with the ZEOSDatastore. Since I am not very experienced with Firebird I'd like to ask interested users to test this example, and maybe to extend it to firebird v2.x or other DB systems.

kkuba

  • New Member
  • *
  • Posts: 47
Re: Postgres, ZEOS and Visual PlanIt - unable to create a table
« Reply #20 on: April 20, 2022, 09:27:42 pm »
@wp I checked example and We have to go back to the beginning. ZEOS 8 has better error handling, but ZEOS 7.2 shows that there are problems with VpZeosDs.
First of all I can see that the code has a confusing reference to the Connected property from Database Connection Component.
For example, see the procedure TVpZeos.Datastore.SetConnected
It says:
  if (AValue = Connected) or (FConnection = nil) then Exit;
  if AValue and AutoCreate and not TablesExist then  CreateTables;
  FConnection.Connected := AValue;
It probably does not make sense. The order is also probably wrong. Shouldn't it be like this?
if FConnection = nil then  Exit;
if AValue = FConnection.Connected then Exit;
FConnection.Connected := AValue;
if AValue and AutoCreate and not TablesExist then CreateTables;
Similar bugs are in procedure TVpZeosDatastore.CreateTables. For example look at wasConnected variable usage.

It's hard for me to improve code because I don't know the whole component. Maybe You could take a look at this?
In my opinion, this problem generates random errors.
« Last Edit: April 21, 2022, 08:56:33 pm by kkuba »

 

TinyPortal © 2005-2018