rdbms and sphnix

32 views
Skip to first unread message

Rita Morgan

unread,
Mar 2, 2012, 11:26:18 PM3/2/12
to sphinx-dev
I have been using sphinx and been liking it a lot. I have several
hundred database queries on oracle and sqlite and I would like to
integrate them into my sphnix document. Basically, a lot of select (*)
from table where field=¨bar¨; I would like to place the output in a
table but not sure what is the best way to do this. Can someone
recommend a proper way or efficient way of doing this?

tia

togakushi

unread,
Mar 3, 2012, 7:29:21 AM3/3/12
to sphinx-dev

Rita

unread,
Mar 3, 2012, 7:44:22 AM3/3/12
to sphin...@googlegroups.com
Thanks for your response! Is there a more generic solution? what if i don't use sqlite


--
You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
To post to this group, send email to sphin...@googlegroups.com.
To unsubscribe from this group, send email to sphinx-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.




--
--- Get your facts first, then you can distort them as you please.--

werner

unread,
Mar 3, 2012, 8:06:27 AM3/3/12
to sphin...@googlegroups.com
On 03/03/2012 13:44, Rita wrote:
Thanks for your response! Is there a more generic solution? what if i don't use sqlite
Have not usee it but as it supports all SQLAlchemy supported db's you have quite a selection:

http://sqlalchemy.readthedocs.org/en/latest/core/engines.html

Werner

Rita

unread,
Mar 3, 2012, 8:32:22 AM3/3/12
to sphin...@googlegroups.com
Ok. thanks

I installed it and have it configured (i think properly). I am able to query the database and the module is loading. 


here is a problem I keep getting,
$ make html
sphinx-build -b html -d build/doctrees   source build/html
Running Sphinx v1.0.1
Initializing SQLTable
loading pickled environment... done
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] index                                                                                                                                                                                 
/home/user/Python/test1/source/index.rst:22: (ERROR/3) Error in "sqltable" directive:
invalid option block.

.. sqltable::
   :sqltable_connection_string: sqlite:///sampledata.db
   select name from users


looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index                                                                                                                                                                                  
writing additional files... (0 module code pages) genindex search
copying static files... done
dumping search index... done
dumping object inventory... done
build succeeded, 1 warning.

Build finished. The HTML pages are in build/html.

werner

unread,
Mar 3, 2012, 8:46:57 AM3/3/12
to sphin...@googlegroups.com
Hi Rita,

On 03/03/2012 14:32, Rita wrote:
> Ok. thanks
>
...


> .. sqltable::
> :sqltable_connection_string: sqlite:///sampledata.db

> select name from users
I think you need a blank line between the select and the :sqltable.... line

Werner

Rita

unread,
Mar 3, 2012, 8:55:31 AM3/3/12
to sphin...@googlegroups.com
you are right. I got a bit further now.


updating environment: 0 added, 1 changed, 0 removed
Connecting to sqlite:///sampledata.db                                                                                                                                                                           
Running query u"select name as 'Name', email as 'E-mail' from users\norder by Name asc"

Exception occurred:
  File "/usr/local/lib/python2.7/dist-packages/sphinxcontrib_sqltable-1.0-py2.7.egg/sphinxcontrib/sqltable.py", line 95, in run
    self.add_name(table_node)
AttributeError: 'SQLTable' object has no attribute 'add_name'




--
You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
To post to this group, send email to sphin...@googlegroups.com.
To unsubscribe from this group, send email to sphinx-dev+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.

werner

unread,
Mar 3, 2012, 10:36:48 AM3/3/12
to sphin...@googlegroups.com
On 03/03/2012 14:55, Rita wrote:
> you are right. I got a bit further now.
>
>
> updating environment: 0 added, 1 changed, 0 removed
> Connecting to sqlite:///sampledata.db
> Running query u"select name as 'Name', email as 'E-mail' from
> users\norder by Name asc"
>
> Exception occurred:
> File
> "/usr/local/lib/python2.7/dist-packages/sphinxcontrib_sqltable-1.0-py2.7.egg/sphinxcontrib/sqltable.py",
> line 95, in run
> self.add_name(table_node)
> AttributeError: 'SQLTable' object has no attribute 'add_name'
No idea on this one, maybe file an issue:
https://bitbucket.org/birkenfeld/sphinx-contrib/issues

Werner

Reply all
Reply to author
Forward
0 new messages