Feature #2781

unixODBC configuration

Added by Stefano Fancello about 7 years ago. Updated about 7 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-unixODBC
Target version:v6.5
Resolution: NEEDINFO:No

Description

This package has to requires unixODBC and create /etc/odbc.ini, taking any db record that has type = "ODBC" and generate odbc appropriate config file using record props

Associated revisions

Revision 6c901e6f
Added by Giacomo Sanchietti about 7 years ago

createlinks, actions: rename action accordingly to conventions. Refs #2781

History

#1 Updated by Giacomo Sanchietti about 7 years ago

  • Status changed from NEW to TRIAGED
  • Target version set to v6.5
  • % Done changed from 0 to 20

#2 Updated by Giacomo Sanchietti about 7 years ago

  • Status changed from TRIAGED to ON_DEV
  • % Done changed from 20 to 30

#3 Updated by Giacomo Sanchietti about 7 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60

#4 Updated by Giacomo Sanchietti about 7 years ago

  • Subject changed from there's a need for a NethServer package that install and configure odbc to unixODBC configuration

#5 Updated by Stefano Fancello about 7 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70
Package in nethserver-testing:
  • nethserver-unixODBC-0.0.2-1.ns6.noarch.rpm

Test case
1. Install nethserver-mysql package and create a test database and table

  # mysql -e "create database test" 
  # mysql test -e 'create table `test` ( `key`  varchar(20), `value`  varchar(20))'
  # mysql test -e "GRANT ALL PRIVILEGES ON test.* TO test@localhost IDENTIFIED BY 'DQAFyzsWsxfZPJuz'" 
  # mysql test -e "INSERT INTO test VALUES ('foo','bar')" 

2. create a new database key
  odbc-test=odbc
      Database=test
      Description=This is a test
      Driver=MySQL
      Port=3306
      Server=localhost

using this command:
   # config set odbc-test odbc Database test Description "This is a test" Driver MySQL Port 3306 Server localhost

3. launch nethserver-unixODBC-update event

  # signal-event nethserver-unixODBC-update

4. check that /etc/odbc.ini contains the new ODBC object

  [odbc-test]
  Server = localhost
  Database = dbname
  Driver = MySQL
  Port = 3306
  Description = This is a test

5. test a query:
open SQL shell

  # isql -v odbc-test test DQAFyzsWsxfZPJuz

and launch a test query
  SQL> select * from test

#6 Updated by Giacomo Sanchietti about 7 years ago

  • Assignee set to Giacomo Sanchietti

#7 Updated by Giacomo Sanchietti about 7 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 90

Test case 1

After creating a new record:

cat /etc/odbc.ini
...
[odbc-test]
Server = localhost
Database = test
Driver = MySQL
Port = 3306
Description = This is a test
...

Query is OK:

[root@localhost ~]# isql -v odbc-test test DQAFyzsWsxfZPJuz
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select * from test;
+---------------------+---------------------+
| key                 | value               |
+---------------------+---------------------+
| foo                 | bar                 |
+---------------------+---------------------+
SQLRowCount returns 1
1 rows fetched

#8 Updated by Giacomo Sanchietti about 7 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Before packaging, following modification have been committed to respect well-known conventions:
  • renamed nethserver-unixODBC-install action to nethserver-unixODBC-conf
  • moved nethserver-unixODBC-conf action from position 90 to 50 inside nethserver-unixODBC-update event
Package released in nethserver-upates:
  • nethserver-unixODBC-0.0.5-1.ns6.noarch.rpm

Also available in: Atom PDF