public inbox for [email protected]  
help / color / mirror / Atom feed
How to create an ODBC datasource in CI
10+ messages / 4 participants
[nested] [flat]

* How to create an ODBC datasource in CI
@ 2024-03-29 11:16 Dave Cramer <[email protected]>
  2024-03-29 12:03 ` Re: How to create an ODBC datasource in CI Clemens Ladisch <[email protected]>
  2024-03-29 12:41 ` Re: How to create an ODBC datasource in CI Jon Raiford <[email protected]>
  0 siblings, 2 replies; 10+ messages in thread

From: Dave Cramer @ 2024-03-29 11:16 UTC (permalink / raw)
  To: pgsql-odbc

Greetings,

In order to test the driver using github actions we need to be able to
create a windows datasource. Usually this requires some kind of user
interaction.

Has anyone done this on GH actions ?


Dave Cramer


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: How to create an ODBC datasource in CI
  2024-03-29 11:16 How to create an ODBC datasource in CI Dave Cramer <[email protected]>
@ 2024-03-29 12:03 ` Clemens Ladisch <[email protected]>
  1 sibling, 0 replies; 10+ messages in thread

From: Clemens Ladisch @ 2024-03-29 12:03 UTC (permalink / raw)
  To: pgsql-odbc

Dave Cramer wrote:
> In order to test the driver using github actions we need to be able to
> create a windows datasource. Usually this requires some kind of user
> interaction.

The ODBC Administrator tool just calls SQLConfigDataSource. You could write your own tool to do this, or add the registry entries directly in HKCU\Software\ODBC\ODBC.INI\ODBC Data Sources.


Best regards,
Clemens





^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: How to create an ODBC datasource in CI
  2024-03-29 11:16 How to create an ODBC datasource in CI Dave Cramer <[email protected]>
@ 2024-03-29 12:41 ` Jon Raiford <[email protected]>
  2024-03-29 15:11   ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  1 sibling, 1 reply; 10+ messages in thread

From: Jon Raiford @ 2024-03-29 12:41 UTC (permalink / raw)
  To: Dave Cramer <[email protected]>; pgsql-odbc

I’m not familiar with GitHub Actions, but I know you can create data sources from the command line. This is all stored in the registry, which you can update using the reg command.

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/reg

The easiest thing to do may be to create a data source manually and export it into a .reg file. You can then either import the data source using the reg file or just use it as a template to add the entries as you like.

Just run Regedit and locate the data source you would like to export.

64-bit System Data Sources: \\HKLM\SOFTWARE\ODBC\</HKLM/SOFTWARE/ODBC/>
32-bit System Data Sources: \\HKLM\SOFTWARE\WOW6432Node\ODBC\</HKLM/SOFTWARE/WOW6432Node/ODBC/>
64-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
32-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\</HKCU/SOFTWARE/ODBC/>     <- This is mixed in with the 64-bit entries and the driver referenced determines if 32/64

Drivers are defined under the system keys under the section ODBCINST.INI. Data sources are defined under the section ODBC.INI, both as a folder containing the details of the data source as well as an entry under “ODBC.INI\ODBC Data Sources”, which associates the data source with the driver to use with it.

I think if you view these entries in Regedit you will see the relationships between everything. It may help to create a data source for each type.

The above describes how to create a static ODBC data source. Alternatively you can use a file DSN or simply make a connection string from your test case and avoid the data source completely. Although I suppose you may want to do each in order to test each possibility.

Let me know if you have any questions or need assistance.

Jon


From: Dave Cramer <[email protected]>
Date: Friday, March 29, 2024 at 7:25 AM
To: PostgreSQL mailing lists <[email protected]>
Subject: How to create an ODBC datasource in CI
Greetings,

In order to test the driver using github actions we need to be able to create a windows datasource. Usually this requires some kind of user interaction.

Has anyone done this on GH actions ?


Dave Cramer


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: How to create an ODBC datasource in CI
  2024-03-29 11:16 How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-29 12:41 ` Re: How to create an ODBC datasource in CI Jon Raiford <[email protected]>
@ 2024-03-29 15:11   ` Dave Cramer <[email protected]>
  2024-03-29 22:48     ` Re: How to create an ODBC datasource in CI Adrian Grucza <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Dave Cramer @ 2024-03-29 15:11 UTC (permalink / raw)
  To: Jon Raiford <[email protected]>; +Cc: pgsql-odbc

On Fri, 29 Mar 2024 at 08:41, Jon Raiford <[email protected]> wrote:

> I’m not familiar with GitHub Actions, but I know you can create data
> sources from the command line. This is all stored in the registry, which
> you can update using the reg command.
>
>
>
>
> https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/reg
>
>
>
> The easiest thing to do may be to create a data source manually and export
> it into a .reg file. You can then either import the data source using the
> reg file or just use it as a template to add the entries as you like.
>
>
> Just run Regedit and locate the data source you would like to export.
>
>
>
> 64-bit System Data Sources: \\HKLM\SOFTWARE\ODBC\
> <http:///HKLM/SOFTWARE/ODBC/;
>
> 32-bit System Data Sources: \\HKLM\SOFTWARE\WOW6432Node\ODBC\
> <http:///HKLM/SOFTWARE/WOW6432Node/ODBC/;
>
> 64-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>
> 32-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
> <http:///HKCU/SOFTWARE/ODBC/;     <- This is mixed in with the 64-bit
> entries and the driver referenced determines if 32/64
>
>
>
> Drivers are defined under the system keys under the section ODBCINST.INI.
> Data sources are defined under the section ODBC.INI, both as a folder
> containing the details of the data source as well as an entry under
> “ODBC.INI\ODBC Data Sources”, which associates the data source with the
> driver to use with it.
>
>
>
> I think if you view these entries in Regedit you will see the
> relationships between everything. It may help to create a data source for
> each type.
>
>
>
> The above describes how to create a static ODBC data source. Alternatively
> you can use a file DSN or simply make a connection string from your test
> case and avoid the data source completely. Although I suppose you may want
> to do each in order to test each possibility.
>
>
>
> Let me know if you have any questions or need assistance.
>
>
>
> Jon
>

Hey Jon,

Thanks, that will help immensely.

It's been a while since I've done anything with Windows.

Dave

>
>
>
>
> *From: *Dave Cramer <[email protected]>
> *Date: *Friday, March 29, 2024 at 7:25 AM
> *To: *PostgreSQL mailing lists <[email protected]>
> *Subject: *How to create an ODBC datasource in CI
>
> Greetings,
>
>
>
> In order to test the driver using github actions we need to be able to
> create a windows datasource. Usually this requires some kind of user
> interaction.
>
>
>
> Has anyone done this on GH actions ?
>
>
>
>
> Dave Cramer
>


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: How to create an ODBC datasource in CI
  2024-03-29 11:16 How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-29 12:41 ` Re: How to create an ODBC datasource in CI Jon Raiford <[email protected]>
  2024-03-29 15:11   ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
@ 2024-03-29 22:48     ` Adrian Grucza <[email protected]>
  2024-03-30 07:52       ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Adrian Grucza @ 2024-03-29 22:48 UTC (permalink / raw)
  To: Dave Cramer <[email protected]>; +Cc: Jon Raiford <[email protected]>; pgsql-odbc

winbuild/regress.ps1 uses RegisterRegdsn.exe (built from
test/RegisterRegdsn.c) to install the driver and register a data source.
You could use that, or you may find it easier to use the Wdac cmdlets
<https://learn.microsoft.com/en-us/powershell/module/wdac/?view=windowsserver2022-ps;
in
PowerShell, specifically Add-OdbcDsn and Set-OdbcDsn.



Adrian Grucza
Technical Lead
Office: +61390185800
[email protected]
www.iress.com
Level 16 385 Bourke St
 Melbourne, Victoria, 3000
The contents of this email originated from Iress. For this purpose Iress includes Iress Limited and/or any of its subsidiaries, holding companies and trading entities. ​If you have received this email in error please notify the sender immediately and delete this email.
nosig
On Sat, 30 Mar 2024 at 2:12 am, Dave Cramer <[email protected]> wrote:

>
>
> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust this
> sender before clicking on any links or attachments.
>
>
>
>
> On Fri, 29 Mar 2024 at 08:41, Jon Raiford <[email protected]> wrote:
>
>> I’m not familiar with GitHub Actions, but I know you can create data
>> sources from the command line. This is all stored in the registry, which
>> you can update using the reg command.
>>
>>
>>
>>
>> https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/reg
>> <https://urldefense.com/v3/__https://learn.microsoft.com/en-us/windows-server/administration/windows-...;
>>
>>
>>
>> The easiest thing to do may be to create a data source manually and
>> export it into a .reg file. You can then either import the data source
>> using the reg file or just use it as a template to add the entries as you
>> like.
>>
>>
>> Just run Regedit and locate the data source you would like to export.
>>
>>
>>
>> 64-bit System Data Sources: \\HKLM\SOFTWARE\ODBC\
>> <https://urldefense.com/v3/__http://HKLM/SOFTWARE/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgAXa9D0wwxO8NO...;
>>
>> 32-bit System Data Sources: \\HKLM\SOFTWARE\WOW6432Node\ODBC\
>> <https://urldefense.com/v3/__http://HKLM/SOFTWARE/WOW6432Node/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgA...;
>>
>> 64-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>>
>> 32-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>> <https://urldefense.com/v3/__http://HKCU/SOFTWARE/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgAXa9D0wwxO8NO...;
>> <- This is mixed in with the 64-bit entries and the driver referenced
>> determines if 32/64
>>
>>
>>
>> Drivers are defined under the system keys under the section ODBCINST.INI.
>> Data sources are defined under the section ODBC.INI, both as a folder
>> containing the details of the data source as well as an entry under
>> “ODBC.INI\ODBC Data Sources”, which associates the data source with the
>> driver to use with it.
>>
>>
>>
>> I think if you view these entries in Regedit you will see the
>> relationships between everything. It may help to create a data source for
>> each type.
>>
>>
>>
>> The above describes how to create a static ODBC data source.
>> Alternatively you can use a file DSN or simply make a connection string
>> from your test case and avoid the data source completely. Although I
>> suppose you may want to do each in order to test each possibility.
>>
>>
>>
>> Let me know if you have any questions or need assistance.
>>
>>
>>
>> Jon
>>
>
> Hey Jon,
>
> Thanks, that will help immensely.
>
> It's been a while since I've done anything with Windows.
>
> Dave
>
>>
>>
>>
>>
>> *From: *Dave Cramer <[email protected]>
>> *Date: *Friday, March 29, 2024 at 7:25 AM
>> *To: *PostgreSQL mailing lists <[email protected]>
>> *Subject: *How to create an ODBC datasource in CI
>>
>> Greetings,
>>
>>
>>
>> In order to test the driver using github actions we need to be able to
>> create a windows datasource. Usually this requires some kind of user
>> interaction.
>>
>>
>>
>> Has anyone done this on GH actions ?
>>
>>
>>
>>
>> Dave Cramer
>>
>


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: How to create an ODBC datasource in CI
  2024-03-29 11:16 How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-29 12:41 ` Re: How to create an ODBC datasource in CI Jon Raiford <[email protected]>
  2024-03-29 15:11   ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-29 22:48     ` Re: How to create an ODBC datasource in CI Adrian Grucza <[email protected]>
@ 2024-03-30 07:52       ` Dave Cramer <[email protected]>
  2024-03-30 10:17         ` Re: How to create an ODBC datasource in CI Adrian Grucza <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Dave Cramer @ 2024-03-30 07:52 UTC (permalink / raw)
  To: Adrian Grucza <[email protected]>; +Cc: Jon Raiford <[email protected]>; pgsql-odbc

On Fri, 29 Mar 2024 at 18:49, Adrian Grucza <[email protected]> wrote:

> winbuild/regress.ps1 uses RegisterRegdsn.exe (built from
> test/RegisterRegdsn.c) to install the driver and register a data source.
> You could use that, or you may find it easier to use the Wdac cmdlets
> <https://learn.microsoft.com/en-us/powershell/module/wdac/?view=windowsserver2022-ps; in
> PowerShell, specifically Add-OdbcDsn and Set-OdbcDsn.
>
>
Yes, I saw those, was going to try them. I think the challenge is
registering the driver first though.

Dave

>
> [image: iress.com] <https://www.iress.com/;
> Adrian Grucza
> Technical Lead
> Office: +61390185800
> [email protected]
> www.iress.com
> Level 16 385 Bourke St  Melbourne,  Victoria,  3000
> The contents of this email originated from Iress. For this purpose Iress
> includes Iress Limited and/or any of its subsidiaries, holding companies
> and trading entities. If you have received this email in error please
> notify the sender immediately and delete this email.
> nosig
> On Sat, 30 Mar 2024 at 2:12 am, Dave Cramer <[email protected]> wrote:
>
>>
>>
>> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust this
>> sender before clicking on any links or attachments.
>>
>>
>>
>>
>> On Fri, 29 Mar 2024 at 08:41, Jon Raiford <[email protected]> wrote:
>>
>>> I’m not familiar with GitHub Actions, but I know you can create data
>>> sources from the command line. This is all stored in the registry, which
>>> you can update using the reg command.
>>>
>>>
>>>
>>>
>>> https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/reg
>>> <https://urldefense.com/v3/__https://learn.microsoft.com/en-us/windows-server/administration/windows-...;
>>>
>>>
>>>
>>> The easiest thing to do may be to create a data source manually and
>>> export it into a .reg file. You can then either import the data source
>>> using the reg file or just use it as a template to add the entries as you
>>> like.
>>>
>>>
>>> Just run Regedit and locate the data source you would like to export.
>>>
>>>
>>>
>>> 64-bit System Data Sources: \\HKLM\SOFTWARE\ODBC\
>>> <https://urldefense.com/v3/__http://HKLM/SOFTWARE/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgAXa9D0wwxO8NO...;
>>>
>>> 32-bit System Data Sources: \\HKLM\SOFTWARE\WOW6432Node\ODBC\
>>> <https://urldefense.com/v3/__http://HKLM/SOFTWARE/WOW6432Node/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgA...;
>>>
>>> 64-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>>>
>>> 32-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>>> <https://urldefense.com/v3/__http://HKCU/SOFTWARE/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgAXa9D0wwxO8NO...;
>>> <- This is mixed in with the 64-bit entries and the driver referenced
>>> determines if 32/64
>>>
>>>
>>>
>>> Drivers are defined under the system keys under the section
>>> ODBCINST.INI. Data sources are defined under the section ODBC.INI, both as
>>> a folder containing the details of the data source as well as an entry
>>> under “ODBC.INI\ODBC Data Sources”, which associates the data source with
>>> the driver to use with it.
>>>
>>>
>>>
>>> I think if you view these entries in Regedit you will see the
>>> relationships between everything. It may help to create a data source for
>>> each type.
>>>
>>>
>>>
>>> The above describes how to create a static ODBC data source.
>>> Alternatively you can use a file DSN or simply make a connection string
>>> from your test case and avoid the data source completely. Although I
>>> suppose you may want to do each in order to test each possibility.
>>>
>>>
>>>
>>> Let me know if you have any questions or need assistance.
>>>
>>>
>>>
>>> Jon
>>>
>>
>> Hey Jon,
>>
>> Thanks, that will help immensely.
>>
>> It's been a while since I've done anything with Windows.
>>
>> Dave
>>
>>>
>>>
>>>
>>>
>>> *From: *Dave Cramer <[email protected]>
>>> *Date: *Friday, March 29, 2024 at 7:25 AM
>>> *To: *PostgreSQL mailing lists <[email protected]>
>>> *Subject: *How to create an ODBC datasource in CI
>>>
>>> Greetings,
>>>
>>>
>>>
>>> In order to test the driver using github actions we need to be able to
>>> create a windows datasource. Usually this requires some kind of user
>>> interaction.
>>>
>>>
>>>
>>> Has anyone done this on GH actions ?
>>>
>>>
>>>
>>>
>>> Dave Cramer
>>>
>>


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: How to create an ODBC datasource in CI
  2024-03-29 11:16 How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-29 12:41 ` Re: How to create an ODBC datasource in CI Jon Raiford <[email protected]>
  2024-03-29 15:11   ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-29 22:48     ` Re: How to create an ODBC datasource in CI Adrian Grucza <[email protected]>
  2024-03-30 07:52       ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
@ 2024-03-30 10:17         ` Adrian Grucza <[email protected]>
  2024-03-30 11:08           ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Adrian Grucza @ 2024-03-30 10:17 UTC (permalink / raw)
  To: Dave Cramer <[email protected]>; +Cc: Jon Raiford <[email protected]>; pgsql-odbc

If your aim is to run the regression tests then winbuild/regress.ps1 does
everything for you: installs a dev version of the driver, creates a DSN for
it and runs the tests against a PostgreSQL server (which you could run in
Docker).

But if you want to use the MSI installer, running that will install the
driver for you:

Start-Process 'C:\\psqlodbc_x64.msi' '/quiet /passive' -PassThru |
Wait-Process;

You then just need to create the DSN:

Add-OdbcDsn -Name "MyPostgresDsn" -DsnType 'User' -Platform '64-bit'
-DriverName 'PostgreSQL Unicode(x64)'

Set-OdbcDsn -Name "MyPostgresDsn" `
 -DsnType "User" `
 -SetPropertyValue @("Servername=${env:DB_HOST}" `
 ,'Port=5432' `
 ,"SSLMode=${env:SSL_MODE}" `
 ,'BoolsAsChar=0' `
 ,'FetchRefcursors=1' `
 ,'MaxVarcharSize=4094' `
 )



Adrian Grucza
Technical Lead
Office: +61390185800
The contents of this email originated from Iress. For this purpose Iress includes Iress Limited and/or any of its subsidiaries, holding companies and trading entities.
​​If you have received this email in error please notify the sender immediately and delete this email.
On Sat, 30 Mar 2024 at 6:53 pm, Dave Cramer <[email protected]> wrote:

>
>
> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust this
> sender before clicking on any links or attachments.
>
>
>
>
> On Fri, 29 Mar 2024 at 18:49, Adrian Grucza <[email protected]>
> wrote:
>
>> winbuild/regress.ps1 uses RegisterRegdsn.exe (built from
>> test/RegisterRegdsn.c) to install the driver and register a data source.
>> You could use that, or you may find it easier to use the Wdac cmdlets
>> <https://urldefense.com/v3/__https://learn.microsoft.com/en-us/powershell/module/wdac/?view=windowsse...; in
>> PowerShell, specifically Add-OdbcDsn and Set-OdbcDsn.
>>
>>
> Yes, I saw those, was going to try them. I think the challenge is
> registering the driver first though.
>
> Dave
>
>>
>> [image: iress.com] <https://www.iress.com/;
>> Adrian Grucza
>> Technical Lead
>> Office: +61390185800
>> [email protected]
>> www.iress.com
>> Level 16 385 Bourke St
>> <https://www.google.com/maps/search/385%C2%A0Bourke%C2%A0St+%C2%A0Melbourne?entry=gmail&source=g;
>>  Melbourne
>> <https://www.google.com/maps/search/385%C2%A0Bourke%C2%A0St+%C2%A0Melbourne?entry=gmail&source=g;
>> ,  Victoria,  3000
>> The contents of this email originated from Iress. For this purpose Iress
>> includes Iress Limited and/or any of its subsidiaries, holding companies
>> and trading entities. If you have received this email in error please
>> notify the sender immediately and delete this email.
>> nosig
>>
> On Sat, 30 Mar 2024 at 2:12 am, Dave Cramer <[email protected]> wrote:
>>
>>>
>>>
>>> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust this
>>> sender before clicking on any links or attachments.
>>>
>>>
>>>
>>>
>>> On Fri, 29 Mar 2024 at 08:41, Jon Raiford <[email protected]> wrote:
>>>
>>>> I’m not familiar with GitHub Actions, but I know you can create data
>>>> sources from the command line. This is all stored in the registry, which
>>>> you can update using the reg command.
>>>>
>>>>
>>>>
>>>>
>>>> https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/reg
>>>> <https://urldefense.com/v3/__https://learn.microsoft.com/en-us/windows-server/administration/windows-...;
>>>>
>>>>
>>>>
>>>> The easiest thing to do may be to create a data source manually and
>>>> export it into a .reg file. You can then either import the data source
>>>> using the reg file or just use it as a template to add the entries as you
>>>> like.
>>>>
>>>>
>>>> Just run Regedit and locate the data source you would like to export.
>>>>
>>>>
>>>>
>>>> 64-bit System Data Sources: \\HKLM\SOFTWARE\ODBC\
>>>> <https://urldefense.com/v3/__http://HKLM/SOFTWARE/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgAXa9D0wwxO8NO...;
>>>>
>>>> 32-bit System Data Sources: \\HKLM\SOFTWARE\WOW6432Node\ODBC\
>>>> <https://urldefense.com/v3/__http://HKLM/SOFTWARE/WOW6432Node/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgA...;
>>>>
>>>> 64-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>>>>
>>>> 32-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>>>> <https://urldefense.com/v3/__http://HKCU/SOFTWARE/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgAXa9D0wwxO8NO...;
>>>> <- This is mixed in with the 64-bit entries and the driver referenced
>>>> determines if 32/64
>>>>
>>>>
>>>>
>>>> Drivers are defined under the system keys under the section
>>>> ODBCINST.INI. Data sources are defined under the section ODBC.INI, both as
>>>> a folder containing the details of the data source as well as an entry
>>>> under “ODBC.INI\ODBC Data Sources”, which associates the data source with
>>>> the driver to use with it.
>>>>
>>>>
>>>>
>>>> I think if you view these entries in Regedit you will see the
>>>> relationships between everything. It may help to create a data source for
>>>> each type.
>>>>
>>>>
>>>>
>>>> The above describes how to create a static ODBC data source.
>>>> Alternatively you can use a file DSN or simply make a connection string
>>>> from your test case and avoid the data source completely. Although I
>>>> suppose you may want to do each in order to test each possibility.
>>>>
>>>>
>>>>
>>>> Let me know if you have any questions or need assistance.
>>>>
>>>>
>>>>
>>>> Jon
>>>>
>>>
>>> Hey Jon,
>>>
>>> Thanks, that will help immensely.
>>>
>>> It's been a while since I've done anything with Windows.
>>>
>>> Dave
>>>
>>>>
>>>>
>>>>
>>>>
>>>> *From: *Dave Cramer <[email protected]>
>>>> *Date: *Friday, March 29, 2024 at 7:25 AM
>>>> *To: *PostgreSQL mailing lists <[email protected]>
>>>> *Subject: *How to create an ODBC datasource in CI
>>>>
>>>> Greetings,
>>>>
>>>>
>>>>
>>>> In order to test the driver using github actions we need to be able to
>>>> create a windows datasource. Usually this requires some kind of user
>>>> interaction.
>>>>
>>>>
>>>>
>>>> Has anyone done this on GH actions ?
>>>>
>>>>
>>>>
>>>>
>>>> Dave Cramer
>>>>
>>>


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: How to create an ODBC datasource in CI
  2024-03-29 11:16 How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-29 12:41 ` Re: How to create an ODBC datasource in CI Jon Raiford <[email protected]>
  2024-03-29 15:11   ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-29 22:48     ` Re: How to create an ODBC datasource in CI Adrian Grucza <[email protected]>
  2024-03-30 07:52       ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-30 10:17         ` Re: How to create an ODBC datasource in CI Adrian Grucza <[email protected]>
@ 2024-03-30 11:08           ` Dave Cramer <[email protected]>
  2024-03-30 11:45             ` Re: How to create an ODBC datasource in CI Adrian Grucza <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Dave Cramer @ 2024-03-30 11:08 UTC (permalink / raw)
  To: Adrian Grucza <[email protected]>; +Cc: Jon Raiford <[email protected]>; pgsql-odbc

On Sat, 30 Mar 2024 at 06:17, Adrian Grucza <[email protected]> wrote:

> If your aim is to run the regression tests then winbuild/regress.ps1 does
> everything for you: installs a dev version of the driver, creates a DSN for
> it and runs the tests against a PostgreSQL server (which you could run in
> Docker).
>
Well the problem is that it waits for input which we can't do on github
actions

>
> But if you want to use the MSI installer, running that will install the
> driver for you:
>
> Start-Process 'C:\\psqlodbc_x64.msi' '/quiet /passive' -PassThru |
> Wait-Process;
>
> You then just need to create the DSN:
>
> Add-OdbcDsn -Name "MyPostgresDsn" -DsnType 'User' -Platform '64-bit'
> -DriverName 'PostgreSQL Unicode(x64)'
>
> Set-OdbcDsn -Name "MyPostgresDsn" `
>  -DsnType "User" `
>  -SetPropertyValue @("Servername=${env:DB_HOST}" `
>  ,'Port=5432' `
>  ,"SSLMode=${env:SSL_MODE}" `
>  ,'BoolsAsChar=0' `
>  ,'FetchRefcursors=1' `
>  ,'MaxVarcharSize=4094' `
>  )
>
> Thanks,

Will try this

Dave

>
> Adrian Grucza
> Technical Lead
> Office: +61390185800
> The contents of this email originated from Iress. For this purpose Iress
> includes Iress Limited and/or any of its subsidiaries, holding companies
> and trading entities.
> If you have received this email in error please notify the sender
> immediately and delete this email.
> On Sat, 30 Mar 2024 at 6:53 pm, Dave Cramer <[email protected]> wrote:
>
>>
>>
>> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust this
>> sender before clicking on any links or attachments.
>>
>>
>>
>>
>> On Fri, 29 Mar 2024 at 18:49, Adrian Grucza <[email protected]>
>> wrote:
>>
>>> winbuild/regress.ps1 uses RegisterRegdsn.exe (built from
>>> test/RegisterRegdsn.c) to install the driver and register a data source.
>>> You could use that, or you may find it easier to use the Wdac cmdlets
>>> <https://urldefense.com/v3/__https://learn.microsoft.com/en-us/powershell/module/wdac/?view=windowsse...; in
>>> PowerShell, specifically Add-OdbcDsn and Set-OdbcDsn.
>>>
>>>
>> Yes, I saw those, was going to try them. I think the challenge is
>> registering the driver first though.
>>
>> Dave
>>
>>>
>>> [image: iress.com] <https://www.iress.com/;
>>> Adrian Grucza
>>> Technical Lead
>>> Office: +61390185800
>>> [email protected]
>>> www.iress.com
>>> Level 16 385 Bourke St
>>> <https://www.google.com/maps/search/385%C2%A0Bourke%C2%A0St+%C2%A0Melbourne?entry=gmail&source=g;
>>>  Melbourne
>>> <https://www.google.com/maps/search/385%C2%A0Bourke%C2%A0St+%C2%A0Melbourne?entry=gmail&source=g;
>>> ,  Victoria,  3000
>>> The contents of this email originated from Iress. For this purpose Iress
>>> includes Iress Limited and/or any of its subsidiaries, holding companies
>>> and trading entities. If you have received this email in error please
>>> notify the sender immediately and delete this email.
>>> nosig
>>>
>> On Sat, 30 Mar 2024 at 2:12 am, Dave Cramer <[email protected]> wrote:
>>>
>>>>
>>>>
>>>> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust
>>>> this sender before clicking on any links or attachments.
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, 29 Mar 2024 at 08:41, Jon Raiford <[email protected]> wrote:
>>>>
>>>>> I’m not familiar with GitHub Actions, but I know you can create data
>>>>> sources from the command line. This is all stored in the registry, which
>>>>> you can update using the reg command.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/reg
>>>>> <https://urldefense.com/v3/__https://learn.microsoft.com/en-us/windows-server/administration/windows-...;
>>>>>
>>>>>
>>>>>
>>>>> The easiest thing to do may be to create a data source manually and
>>>>> export it into a .reg file. You can then either import the data source
>>>>> using the reg file or just use it as a template to add the entries as you
>>>>> like.
>>>>>
>>>>>
>>>>> Just run Regedit and locate the data source you would like to export.
>>>>>
>>>>>
>>>>>
>>>>> 64-bit System Data Sources: \\HKLM\SOFTWARE\ODBC\
>>>>> <https://urldefense.com/v3/__http://HKLM/SOFTWARE/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgAXa9D0wwxO8NO...;
>>>>>
>>>>> 32-bit System Data Sources: \\HKLM\SOFTWARE\WOW6432Node\ODBC\
>>>>> <https://urldefense.com/v3/__http://HKLM/SOFTWARE/WOW6432Node/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgA...;
>>>>>
>>>>> 64-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>>>>>
>>>>> 32-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>>>>> <https://urldefense.com/v3/__http://HKCU/SOFTWARE/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgAXa9D0wwxO8NO...;
>>>>> <- This is mixed in with the 64-bit entries and the driver referenced
>>>>> determines if 32/64
>>>>>
>>>>>
>>>>>
>>>>> Drivers are defined under the system keys under the section
>>>>> ODBCINST.INI. Data sources are defined under the section ODBC.INI, both as
>>>>> a folder containing the details of the data source as well as an entry
>>>>> under “ODBC.INI\ODBC Data Sources”, which associates the data source with
>>>>> the driver to use with it.
>>>>>
>>>>>
>>>>>
>>>>> I think if you view these entries in Regedit you will see the
>>>>> relationships between everything. It may help to create a data source for
>>>>> each type.
>>>>>
>>>>>
>>>>>
>>>>> The above describes how to create a static ODBC data source.
>>>>> Alternatively you can use a file DSN or simply make a connection string
>>>>> from your test case and avoid the data source completely. Although I
>>>>> suppose you may want to do each in order to test each possibility.
>>>>>
>>>>>
>>>>>
>>>>> Let me know if you have any questions or need assistance.
>>>>>
>>>>>
>>>>>
>>>>> Jon
>>>>>
>>>>
>>>> Hey Jon,
>>>>
>>>> Thanks, that will help immensely.
>>>>
>>>> It's been a while since I've done anything with Windows.
>>>>
>>>> Dave
>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> *From: *Dave Cramer <[email protected]>
>>>>> *Date: *Friday, March 29, 2024 at 7:25 AM
>>>>> *To: *PostgreSQL mailing lists <[email protected]>
>>>>> *Subject: *How to create an ODBC datasource in CI
>>>>>
>>>>> Greetings,
>>>>>
>>>>>
>>>>>
>>>>> In order to test the driver using github actions we need to be able to
>>>>> create a windows datasource. Usually this requires some kind of user
>>>>> interaction.
>>>>>
>>>>>
>>>>>
>>>>> Has anyone done this on GH actions ?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Dave Cramer
>>>>>
>>>>


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: How to create an ODBC datasource in CI
  2024-03-29 11:16 How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-29 12:41 ` Re: How to create an ODBC datasource in CI Jon Raiford <[email protected]>
  2024-03-29 15:11   ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-29 22:48     ` Re: How to create an ODBC datasource in CI Adrian Grucza <[email protected]>
  2024-03-30 07:52       ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-30 10:17         ` Re: How to create an ODBC datasource in CI Adrian Grucza <[email protected]>
  2024-03-30 11:08           ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
@ 2024-03-30 11:45             ` Adrian Grucza <[email protected]>
  2024-04-01 20:20               ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  0 siblings, 1 reply; 10+ messages in thread

From: Adrian Grucza @ 2024-03-30 11:45 UTC (permalink / raw)
  To: Dave Cramer <[email protected]>; +Cc: Jon Raiford <[email protected]>; pgsql-odbc

You might consider adding an optional "DsnProperties" string parameter to
regress.ps1. When provided, the script could use that property string to
create the DSN instead of calling input-dsninfo to prompt for the
properties. In general I think it's preferable for CI to run tests using
the same script that people use when developing psqlODBC locally. That way
if the script ever breaks, then the break will be detected in CI. But I
think it's also useful to test the MSI installer, which regress.ps1 doesn't
do.



Adrian Grucza
Technical Lead
Office: +61390185800
The contents of this email originated from Iress. For this purpose Iress includes Iress Limited and/or any of its subsidiaries, holding companies and trading entities.
​​If you have received this email in error please notify the sender immediately and delete this email.
On Sat, 30 Mar 2024 at 22:09, Dave Cramer <[email protected]> wrote:

>
>
> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust this
> sender before clicking on any links or attachments.
>
>
>
>
>
> On Sat, 30 Mar 2024 at 06:17, Adrian Grucza <[email protected]>
> wrote:
>
>> If your aim is to run the regression tests then winbuild/regress.ps1 does
>> everything for you: installs a dev version of the driver, creates a DSN for
>> it and runs the tests against a PostgreSQL server (which you could run in
>> Docker).
>>
> Well the problem is that it waits for input which we can't do on github
> actions
>
>>
>> But if you want to use the MSI installer, running that will install the
>> driver for you:
>>
>> Start-Process 'C:\\psqlodbc_x64.msi' '/quiet /passive' -PassThru |
>> Wait-Process;
>>
>> You then just need to create the DSN:
>>
>> Add-OdbcDsn -Name "MyPostgresDsn" -DsnType 'User' -Platform '64-bit'
>> -DriverName 'PostgreSQL Unicode(x64)'
>>
>> Set-OdbcDsn -Name "MyPostgresDsn" `
>>  -DsnType "User" `
>>  -SetPropertyValue @("Servername=${env:DB_HOST}" `
>>  ,'Port=5432' `
>>  ,"SSLMode=${env:SSL_MODE}" `
>>  ,'BoolsAsChar=0' `
>>  ,'FetchRefcursors=1' `
>>  ,'MaxVarcharSize=4094' `
>>  )
>>
>> Thanks,
>
> Will try this
>
> Dave
>
>>
>> Adrian Grucza
>> Technical Lead
>> Office: +61390185800
>> The contents of this email originated from Iress. For this purpose Iress
>> includes Iress Limited and/or any of its subsidiaries, holding companies
>> and trading entities.
>> If you have received this email in error please notify the sender
>> immediately and delete this email.
>> On Sat, 30 Mar 2024 at 6:53 pm, Dave Cramer <[email protected]> wrote:
>>
>>>
>>>
>>> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust this
>>> sender before clicking on any links or attachments.
>>>
>>>
>>>
>>>
>>> On Fri, 29 Mar 2024 at 18:49, Adrian Grucza <[email protected]>
>>> wrote:
>>>
>>>> winbuild/regress.ps1 uses RegisterRegdsn.exe (built from
>>>> test/RegisterRegdsn.c) to install the driver and register a data source.
>>>> You could use that, or you may find it easier to use the Wdac cmdlets
>>>> <https://urldefense.com/v3/__https://learn.microsoft.com/en-us/powershell/module/wdac/?view=windowsse...; in
>>>> PowerShell, specifically Add-OdbcDsn and Set-OdbcDsn.
>>>>
>>>>
>>> Yes, I saw those, was going to try them. I think the challenge is
>>> registering the driver first though.
>>>
>>> Dave
>>>
>>>>
>>>> [image: iress.com] <https://www.iress.com/;
>>>> Adrian Grucza
>>>> Technical Lead
>>>> Office: +61390185800
>>>> [email protected]
>>>> www.iress.com
>>>> Level 16 385 Bourke St
>>>> <https://urldefense.com/v3/__https://www.google.com/maps/search/385**ABourke**ASt**BMelbourne?entry=g...;
>>>>  Melbourne
>>>> <https://urldefense.com/v3/__https://www.google.com/maps/search/385**ABourke**ASt**BMelbourne?entry=g...;
>>>> ,  Victoria,  3000
>>>> The contents of this email originated from Iress. For this purpose
>>>> Iress includes Iress Limited and/or any of its subsidiaries, holding
>>>> companies and trading entities. If you have received this email in error
>>>> please notify the sender immediately and delete this email.
>>>> nosig
>>>>
>>> On Sat, 30 Mar 2024 at 2:12 am, Dave Cramer <[email protected]>
>>>> wrote:
>>>>
>>>>>
>>>>>
>>>>> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust
>>>>> this sender before clicking on any links or attachments.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Fri, 29 Mar 2024 at 08:41, Jon Raiford <[email protected]> wrote:
>>>>>
>>>>>> I’m not familiar with GitHub Actions, but I know you can create data
>>>>>> sources from the command line. This is all stored in the registry, which
>>>>>> you can update using the reg command.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/reg
>>>>>> <https://urldefense.com/v3/__https://learn.microsoft.com/en-us/windows-server/administration/windows-...;
>>>>>>
>>>>>>
>>>>>>
>>>>>> The easiest thing to do may be to create a data source manually and
>>>>>> export it into a .reg file. You can then either import the data source
>>>>>> using the reg file or just use it as a template to add the entries as you
>>>>>> like.
>>>>>>
>>>>>>
>>>>>> Just run Regedit and locate the data source you would like to export.
>>>>>>
>>>>>>
>>>>>>
>>>>>> 64-bit System Data Sources: \\HKLM\SOFTWARE\ODBC\
>>>>>> <https://urldefense.com/v3/__http://HKLM/SOFTWARE/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgAXa9D0wwxO8NO...;
>>>>>>
>>>>>> 32-bit System Data Sources: \\HKLM\SOFTWARE\WOW6432Node\ODBC\
>>>>>> <https://urldefense.com/v3/__http://HKLM/SOFTWARE/WOW6432Node/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgA...;
>>>>>>
>>>>>> 64-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>>>>>>
>>>>>> 32-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>>>>>> <https://urldefense.com/v3/__http://HKCU/SOFTWARE/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgAXa9D0wwxO8NO...;
>>>>>> <- This is mixed in with the 64-bit entries and the driver referenced
>>>>>> determines if 32/64
>>>>>>
>>>>>>
>>>>>>
>>>>>> Drivers are defined under the system keys under the section
>>>>>> ODBCINST.INI. Data sources are defined under the section ODBC.INI, both as
>>>>>> a folder containing the details of the data source as well as an entry
>>>>>> under “ODBC.INI\ODBC Data Sources”, which associates the data source with
>>>>>> the driver to use with it.
>>>>>>
>>>>>>
>>>>>>
>>>>>> I think if you view these entries in Regedit you will see the
>>>>>> relationships between everything. It may help to create a data source for
>>>>>> each type.
>>>>>>
>>>>>>
>>>>>>
>>>>>> The above describes how to create a static ODBC data source.
>>>>>> Alternatively you can use a file DSN or simply make a connection string
>>>>>> from your test case and avoid the data source completely. Although I
>>>>>> suppose you may want to do each in order to test each possibility.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Let me know if you have any questions or need assistance.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Jon
>>>>>>
>>>>>
>>>>> Hey Jon,
>>>>>
>>>>> Thanks, that will help immensely.
>>>>>
>>>>> It's been a while since I've done anything with Windows.
>>>>>
>>>>> Dave
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> *From: *Dave Cramer <[email protected]>
>>>>>> *Date: *Friday, March 29, 2024 at 7:25 AM
>>>>>> *To: *PostgreSQL mailing lists <[email protected]>
>>>>>> *Subject: *How to create an ODBC datasource in CI
>>>>>>
>>>>>> Greetings,
>>>>>>
>>>>>>
>>>>>>
>>>>>> In order to test the driver using github actions we need to be able
>>>>>> to create a windows datasource. Usually this requires some kind of user
>>>>>> interaction.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Has anyone done this on GH actions ?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Dave Cramer
>>>>>>
>>>>>


^ permalink  raw  reply  [nested|flat] 10+ messages in thread

* Re: How to create an ODBC datasource in CI
  2024-03-29 11:16 How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-29 12:41 ` Re: How to create an ODBC datasource in CI Jon Raiford <[email protected]>
  2024-03-29 15:11   ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-29 22:48     ` Re: How to create an ODBC datasource in CI Adrian Grucza <[email protected]>
  2024-03-30 07:52       ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-30 10:17         ` Re: How to create an ODBC datasource in CI Adrian Grucza <[email protected]>
  2024-03-30 11:08           ` Re: How to create an ODBC datasource in CI Dave Cramer <[email protected]>
  2024-03-30 11:45             ` Re: How to create an ODBC datasource in CI Adrian Grucza <[email protected]>
@ 2024-04-01 20:20               ` Dave Cramer <[email protected]>
  0 siblings, 0 replies; 10+ messages in thread

From: Dave Cramer @ 2024-04-01 20:20 UTC (permalink / raw)
  To: Adrian Grucza <[email protected]>; +Cc: Jon Raiford <[email protected]>; pgsql-odbc

On Sat, 30 Mar 2024 at 07:45, Adrian Grucza <[email protected]> wrote:

> You might consider adding an optional "DsnProperties" string parameter to
> regress.ps1. When provided, the script could use that property string to
> create the DSN instead of calling input-dsninfo to prompt for the
> properties. In general I think it's preferable for CI to run tests using
> the same script that people use when developing psqlODBC locally. That way
> if the script ever breaks, then the break will be detected in CI. But I
> think it's also useful to test the MSI installer, which regress.ps1 doesn't
> do.
>
>
Did that, and it works, have one test failing because libxml2 isn't
installed.

create database and dsn · davecramer/psqlodbc@982bd55 (github.com)
<https://github.com/davecramer/psqlodbc/commit/982bd5525af1b0cc6b3c8c47000b6916a61ed388;

Anyone know how to install it on windows?

Dave

> On Sat, 30 Mar 2024 at 22:09, Dave Cramer <[email protected]> wrote:
>
>>
>>
>> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust this
>> sender before clicking on any links or attachments.
>>
>>
>>
>>
>>
>> On Sat, 30 Mar 2024 at 06:17, Adrian Grucza <[email protected]>
>> wrote:
>>
>>> If your aim is to run the regression tests then winbuild/regress.ps1
>>> does everything for you: installs a dev version of the driver, creates a
>>> DSN for it and runs the tests against a PostgreSQL server (which you could
>>> run in Docker).
>>>
>> Well the problem is that it waits for input which we can't do on github
>> actions
>>
>>>
>>> But if you want to use the MSI installer, running that will install the
>>> driver for you:
>>>
>>> Start-Process 'C:\\psqlodbc_x64.msi' '/quiet /passive' -PassThru |
>>> Wait-Process;
>>>
>>> You then just need to create the DSN:
>>>
>>> Add-OdbcDsn -Name "MyPostgresDsn" -DsnType 'User' -Platform '64-bit'
>>> -DriverName 'PostgreSQL Unicode(x64)'
>>>
>>> Set-OdbcDsn -Name "MyPostgresDsn" `
>>>  -DsnType "User" `
>>>  -SetPropertyValue @("Servername=${env:DB_HOST}" `
>>>  ,'Port=5432' `
>>>  ,"SSLMode=${env:SSL_MODE}" `
>>>  ,'BoolsAsChar=0' `
>>>  ,'FetchRefcursors=1' `
>>>  ,'MaxVarcharSize=4094' `
>>>  )
>>>
>>> Thanks,
>>
>> Will try this
>>
>> Dave
>>
>>>
>>> Adrian Grucza
>>> Technical Lead
>>> Office: +61390185800
>>> The contents of this email originated from Iress. For this purpose Iress
>>> includes Iress Limited and/or any of its subsidiaries, holding companies
>>> and trading entities.
>>> If you have received this email in error please notify the sender
>>> immediately and delete this email.
>>> On Sat, 30 Mar 2024 at 6:53 pm, Dave Cramer <[email protected]>
>>> wrote:
>>>
>>>>
>>>>
>>>> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust
>>>> this sender before clicking on any links or attachments.
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, 29 Mar 2024 at 18:49, Adrian Grucza <[email protected]>
>>>> wrote:
>>>>
>>>>> winbuild/regress.ps1 uses RegisterRegdsn.exe (built from
>>>>> test/RegisterRegdsn.c) to install the driver and register a data source.
>>>>> You could use that, or you may find it easier to use the Wdac cmdlets
>>>>> <https://urldefense.com/v3/__https://learn.microsoft.com/en-us/powershell/module/wdac/?view=windowsse...; in
>>>>> PowerShell, specifically Add-OdbcDsn and Set-OdbcDsn.
>>>>>
>>>>>
>>>> Yes, I saw those, was going to try them. I think the challenge is
>>>> registering the driver first though.
>>>>
>>>> Dave
>>>>
>>>>>
>>>>> [image: iress.com] <https://www.iress.com/;
>>>>> Adrian Grucza
>>>>> Technical Lead
>>>>> Office: +61390185800
>>>>> [email protected]
>>>>> www.iress.com
>>>>> Level 16 385 Bourke St
>>>>> <https://urldefense.com/v3/__https://www.google.com/maps/search/385**ABourke**ASt**BMelbourne?entry=g...;
>>>>>  Melbourne
>>>>> <https://urldefense.com/v3/__https://www.google.com/maps/search/385**ABourke**ASt**BMelbourne?entry=g...;
>>>>> ,  Victoria,  3000
>>>>> The contents of this email originated from Iress. For this purpose
>>>>> Iress includes Iress Limited and/or any of its subsidiaries, holding
>>>>> companies and trading entities. If you have received this email in error
>>>>> please notify the sender immediately and delete this email.
>>>>> nosig
>>>>>
>>>> On Sat, 30 Mar 2024 at 2:12 am, Dave Cramer <[email protected]>
>>>>> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust
>>>>>> this sender before clicking on any links or attachments.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, 29 Mar 2024 at 08:41, Jon Raiford <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> I’m not familiar with GitHub Actions, but I know you can create data
>>>>>>> sources from the command line. This is all stored in the registry, which
>>>>>>> you can update using the reg command.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/reg
>>>>>>> <https://urldefense.com/v3/__https://learn.microsoft.com/en-us/windows-server/administration/windows-...;
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> The easiest thing to do may be to create a data source manually and
>>>>>>> export it into a .reg file. You can then either import the data source
>>>>>>> using the reg file or just use it as a template to add the entries as you
>>>>>>> like.
>>>>>>>
>>>>>>>
>>>>>>> Just run Regedit and locate the data source you would like to export.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 64-bit System Data Sources: \\HKLM\SOFTWARE\ODBC\
>>>>>>> <https://urldefense.com/v3/__http://HKLM/SOFTWARE/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgAXa9D0wwxO8NO...;
>>>>>>>
>>>>>>> 32-bit System Data Sources: \\HKLM\SOFTWARE\WOW6432Node\ODBC\
>>>>>>> <https://urldefense.com/v3/__http://HKLM/SOFTWARE/WOW6432Node/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgA...;
>>>>>>>
>>>>>>> 64-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>>>>>>>
>>>>>>> 32-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\
>>>>>>> <https://urldefense.com/v3/__http://HKCU/SOFTWARE/ODBC/__;!!OSkwEA!kxnwxUJLKxa3Oc4LrkTTgAXa9D0wwxO8NO...;
>>>>>>> <- This is mixed in with the 64-bit entries and the driver referenced
>>>>>>> determines if 32/64
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Drivers are defined under the system keys under the section
>>>>>>> ODBCINST.INI. Data sources are defined under the section ODBC.INI, both as
>>>>>>> a folder containing the details of the data source as well as an entry
>>>>>>> under “ODBC.INI\ODBC Data Sources”, which associates the data source with
>>>>>>> the driver to use with it.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I think if you view these entries in Regedit you will see the
>>>>>>> relationships between everything. It may help to create a data source for
>>>>>>> each type.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> The above describes how to create a static ODBC data source.
>>>>>>> Alternatively you can use a file DSN or simply make a connection string
>>>>>>> from your test case and avoid the data source completely. Although I
>>>>>>> suppose you may want to do each in order to test each possibility.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Let me know if you have any questions or need assistance.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Jon
>>>>>>>
>>>>>>
>>>>>> Hey Jon,
>>>>>>
>>>>>> Thanks, that will help immensely.
>>>>>>
>>>>>> It's been a while since I've done anything with Windows.
>>>>>>
>>>>>> Dave
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *From: *Dave Cramer <[email protected]>
>>>>>>> *Date: *Friday, March 29, 2024 at 7:25 AM
>>>>>>> *To: *PostgreSQL mailing lists <[email protected]>
>>>>>>> *Subject: *How to create an ODBC datasource in CI
>>>>>>>
>>>>>>> Greetings,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> In order to test the driver using github actions we need to be able
>>>>>>> to create a windows datasource. Usually this requires some kind of user
>>>>>>> interaction.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Has anyone done this on GH actions ?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Dave Cramer
>>>>>>>
>>>>>>


^ permalink  raw  reply  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2024-04-01 20:20 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-03-29 11:16 How to create an ODBC datasource in CI Dave Cramer <[email protected]>
2024-03-29 12:03 ` Clemens Ladisch <[email protected]>
2024-03-29 12:41 ` Jon Raiford <[email protected]>
2024-03-29 15:11   ` Dave Cramer <[email protected]>
2024-03-29 22:48     ` Adrian Grucza <[email protected]>
2024-03-30 07:52       ` Dave Cramer <[email protected]>
2024-03-30 10:17         ` Adrian Grucza <[email protected]>
2024-03-30 11:08           ` Dave Cramer <[email protected]>
2024-03-30 11:45             ` Adrian Grucza <[email protected]>
2024-04-01 20:20               ` Dave Cramer <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox