[Gambas Bug Tracker] Bug #1108: sqlite path when used with name does not create db in the given path

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Gambas Bug Tracker] Bug #1108: sqlite path when used with name does not create db in the given path

bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1108&from=L21haW4-

PICCORO LENZ MCKAY reported a new bug.

Summary
-------

sqlite path when used with name does not create db in the given path

Type             : Bug
Priority         : High
Gambas version   : 3.9
Product          : Database component


Description
-----------

i attached a project example, in resumen i used as documentation said: "Otherwise, Host gives the database directory, and the database path is the result of concatenating Host and Name." in http://gambaswiki.org/wiki/comp/gb.db/connection

so i used host for path directory and name for sqlite name db, but when i command a ls to the patch the sqlite db does not exist


System information
------------------

[System]
Gambas=3.9.1
OperatingSystem=Linux
Kernel=2.6.38-bpo.2-686
Architecture=x86
Distribution=<hostname> 6.1
Desktop=
Theme=Gtk
Language=es_VE.UTF-8
Memory=2958M

[Libraries]
Cairo=libcairo.so.2.11000.2
Curl=libcurl.so.4.2.0
DBus=libdbus-1.so.3.4.0
GStreamer=libgstreamer-0.10.so.0.27.0
GTK+2=libgtk-x11-2.0.so.0.2000.1
Poppler=libpoppler.so.5.0.0
QT4=libQtCore.so.4.7.4
SDL=libSDL-1.2.so.0.11.4
SQLite=libsqlite3.so.0.8.6

[Environment]
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-vBmVAKTmAe,guid=ab802896e9e02a1f9130b5430000020a
DESKTOP_SESSION=openbox
DISPLAY=:0.0
GB_GUI=gb.qt4
GDMSESSION=openbox
GDM_LANG=es_VE.UTF-8
GDM_XSERVER_LOCATION=local
HOME=<home>
LANG=es_VE.UTF-8
LOGNAME=<user>
ORBIT_SOCKETDIR=/tmp/orbit-<user>
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
PWD=<home>
SHELL=/bin/bash
SSH_AGENT_PID=3169
SSH_AUTH_SOCK=/tmp/ssh-ufENJB3126/agent.3126
TZ=:/etc/localtime
USER=<user>
USERNAME=<user>
WINDOWPATH=7:7:7:7
XAUTHORITY=<home>/.Xauthority
XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/
XDG_MENU_PREFIX=lxde-
XDG_SESSION_COOKIE=e95ad835c51ba625379e246200000423-1494956351.268990-1110310328



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Gambas Bug Tracker] Bug #1108: sqlite path when used with name does not create db in the given path

bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1108&from=L21haW4-

PICCORO LENZ MCKAY added an attachment:

testforbugs-sqlitepath-notfoud-db-0.0.1.tar.gz



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Gambas Bug Tracker] Bug #1108: sqlite path when used with name does not create db in the given path

bugtracker
In reply to this post by bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1108&from=L21haW4-

Comment #1 by PICCORO LENZ MCKAY:

the piece of code its:


Private $conexionsqli As Connection

Public Function getConexion()
 
  Try Kill Application.Path & "/test"  ' clean the patch firts

  $conexionsqli = New Connection
  $conexionsqli.Type = "sqlite3"
  $conexionsqli.Name = Null  ' doc said if null given memory db will be used and i create a db from now
 
  Try $conexionsqli.Open
  $conexionsqli.Databases.Add("test") ' so connected to memory db create a new db in given path ? how can i set the path? if the db arememory db?
 
  $conexionsqli.Close ' doc say: Otherwise, Host gives the database directory, and the database path is the result of concatenating Host and Name.

  $conexionsqli.Host = Application.Path
  $conexionsqli.Name = "test"
  Try $conexionsqli.Open
 
  If Error Then
    $conexionsqli = Null
  Endif  
 
  'Return $conexionsqli
 
End



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Gambas Bug Tracker] Bug #1108: sqlite path when used with name does not create db in the given path

bugtracker
In reply to this post by bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1108&from=L21haW4-

Comment #2 by Tobias BOEGE:

You forgot to set $conexionsqli.Host = Application.Path before calling Databases.Add(). (Where did you expect the database to go without giving it a host?) Try this:

Public Function getConexion()
  ' Clear directory
  Try Kill Application.Path & "/test"

  $conexionsqli = New Connection
  $conexionsqli.Type = "sqlite3"
  ' "Connect" to the host (i.e. the directory where we create the database)
  $conexionsqli.Host = Application.Path
  ' There is no database yet, so set Name = Null
  $conexionsqli.Name = Null
  $conexionsqli.Open()
  ' Add the database and close the connection
  $conexionsqli.Databases.Add("test")
  $conexionsqli.Close()
  ' Afterwards we can select the now-existing database
  $conexionsqli.Name = "test"
  $conexionsqli.Open()
End

Tobias BOEGE changed the state of the bug to: Invalid.



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Gambas Bug Tracker] Bug #1108: sqlite path when used with name does not create db in the given path

bugtracker
In reply to this post by bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1108&from=L21haW4-

Comment #3 by PICCORO LENZ MCKAY:

Thanks for the info tobias. so this bug its then invalid.. maybe a example in gambas wiki can iluminate the non-english users!



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Loading...