Questions tagged [python-elixir]

A Python library that sits upon SQLAlchemy

Elixir is a Python library that sits on top of SQLAlchemy. Questions using this tag should also be tagged .

Further reading:

76 questions
66
votes
5 answers

Selecting distinct column values in SQLAlchemy/Elixir

In a little script I'm writing using SQLAlchemy and Elixir, I need to get all the distinct values for a particular column. In ordinary SQL it'd be a simple matter of SELECT DISTINCT `column` FROM `table`; and I know I could just run that query…
David Z
  • 116,302
  • 26
  • 230
  • 268
23
votes
8 answers

dump csv from sqlalchemy

For some reason, I want to dump a table from a database (sqlite3) in the form of a csv file. I'm using a python script with elixir (based on sqlalchemy) to modify the database. I was wondering if there is any way to dump the table I use to csv. I've…
tmoisan
  • 1,162
  • 2
  • 9
  • 26
11
votes
1 answer

Should I be using SQLObject, SQLAlchemy, or SQLAlchemy + Elixir?

I've been using SQLObject for a long while, but noticed that SQLAlchemy has become a lot more popular in the last couple years: http://www.google.com/trends?q=sqlobject,+sqlalchemy Are there compelling reasons to switch to SQLAlchemy? How is its…
mote
  • 180
  • 1
  • 9
11
votes
3 answers

Update an sqlite database schema with sqlalchemy and elixir

I've created a python application which uses elixir/sqlalchemy to store data. The second release of the software requires any files created in the previous version to be updated in order to add/delete tables and columns. My question is: how can I…
Jon
  • 8,066
  • 8
  • 43
  • 62
10
votes
4 answers

Impossible to initialize Elixir

I'm starting with Elixir and SQL Alchemy. I've created a python file connecting with a Mysql database to but as soon as I execute with python I get the error bellow: root@raspberrypi:/Python/mainFlask/yonkiPOPS# python yonki.py Traceback (most…
8
votes
4 answers

MySQL server has gone away - Disconnect handling via checkout event handler doesn't work

Update 3/4: I've done some testing and proved that using checkout event handler to check disconnects works with Elixir. Beginning to think my problem has something to do with calling session.commit() from a subprocess? Update: I just disproved…
8
votes
2 answers

Difference between ":", "@" and nothing in python docstrings

I'm just trying to get a better feel for the layout of Python docstrings (Between the """ """) I've seen docstrings with different layouts...such as... """ @DESCRIPTION Ive seen tags STARTING with an at-sign :DESCRIPTION: Tags with…
RightmireM
  • 2,035
  • 1
  • 17
  • 31
8
votes
3 answers

Nested transactions with SQLAlchemy and sqlite

I'm writing an application in Python using SQLAlchemy (and Elixir) with SQLite as the database backend. I start a new transaction using the code session.begin_transaction(), but when I call session.rollback() I get the following…
Jon
  • 8,066
  • 8
  • 43
  • 62
7
votes
3 answers

What are the benefits of using Elixir

... vs declarative sqlalchemy ?
ychaouche
  • 4,242
  • 2
  • 40
  • 45
7
votes
2 answers

Pylons with Elixir

I would like to use Pylons with Elixir, however, I am not sure what is the best way to get about doing this. There are several blog posts (cleverdevil, beachcoder, adam hoscilo) and even an entire new framework about how to go about doing this;…
Swati
  • 40,962
  • 4
  • 35
  • 53
6
votes
2 answers

Issues with scoped_session in sqlalchemy - how does it work?

I'm not really sure how scoped_session works, other than it seems to be a wrapper that hides several real sessions, keeping them separate for different requests. Does it do this with thread locals? Anyway the trouble is as follows: S =…
Eloff
  • 18,456
  • 14
  • 72
  • 96
6
votes
1 answer

SQLAlchemy declarative extension vs. elixir

I am planning to use SQLAlchemy in one of my projects and i am very interested in declarative syntax of tables. I was told to use the Elixir Declarative Layer for that, at the same time SQLAlchemy has its built-in declarative extension. What are the…
warvariuc
  • 50,202
  • 34
  • 156
  • 216
5
votes
5 answers

Execute sql query with Elixir

I'm using Elixir in a project that connects to a postgres database. I want to run the following query on the database I'm connected to, but I'm not sure how to do it as I'm rather new to Elixir and SQLAlchemy. Anyone know how? VACUUM FULL ANALYZE…
mozillalives
  • 1,430
  • 15
  • 25
4
votes
2 answers

How to iterate through every class declaration, descended from a particular base class?

I was wandering how does elixir\sqlalchemy get to know all the entity classes I've declared in my model, when I call setup_all()? I need that kind of functionality in a little project of mine, but I have no clue. I've tried to steptrace through…
AlexVhr
  • 1,726
  • 1
  • 16
  • 28
4
votes
1 answer

Using sqlalchemy.sql.functions.char_length as a filter condition

I'm using Elixir and sqla 0.6, and I'm trying to query my model: class Document(Entity): using_options(shortnames=True, order_by='doc_date') doc_number = Field(Unicode(20),index=True) ...for Documents having numbers of a given length. I…
AlexVhr
  • 1,726
  • 1
  • 16
  • 28
1
2 3 4 5 6