On 01/22/2010 03:07 PM, Manlio Perillo wrote: > Non capisco i suoi dubbi. > > Se fai una INSERT su una view, è il database che decide cosa fare, non > sei tu a doverti preoccupare.
Si' ma ogni DB si comporta a modo suo, e se Bayer non puo' garantire nulla, preferisce che non faccia parte delle funzionalita' "core". > Io da un pò di tempo sto pensando di lasciar perdere il supporto DDL di > SQLAlchemy, ed invece di descrivere lo schema in SQL direttamente Io l'ho sempre fatto dalla 0.3. Giusto un po' lento a partire, perche' fa molte query su information_schema. Infinitamente piu' semplice da leggere e comprendere, soprattutto per il mio project manager. Per ottimizzare, ho provato anche a serializzare gli oggetti Table in pickle, ma sono file talmente grandi che impiegava lo stesso tempo.. Volendo si puo' anche automatizzare la traduzione di schemi MySQL (caricati con autoload) con target postgres o altri DB. Naturalmente si blocca su colonne data con default 0000-00-00 e simili nefandezze, ma credo si potrebbe costruire un tool attorno a questa feature. > (sviluppando poi il supporto per creare una tabella SQLAlchemy a partire > dalla definizione della tabella in una stringa SQL). Ovvero se ho capito bene, prendo stringa, poi creo e autoload. Si puo' fare un po' tutto... Esempio, preso da una mia applicazione Inizio dei test: legge lo schema da un file ed esegue sul db 'undertest'; inserisce dati fixture; successivo autoload dello schema e caricamento del programma Per ogni test, nelle setup e teardown: - se non ha bisogno del db, meglio - se ha bisogno del DB ma e' un test del modello, eseguo test in una transazione + ROLLBACK - se e' un test di controller web, che gira in una sua transazione, eseguo test + TRUNCATE ALL e fixture Mi rendo conto che con sqlite i test sarebbero piu' veloci, ma l'applicazione sarebbe di conseguenza molto piu' complicata e fragile. -- This e-mail (and any attachment(s)) is strictly confidential and for use only by intended recipient(s). Any use, distribution, reproduction or disclosure by any other person is strictly prohibited. The content of this e-mail does not constitute a commitment by the Company except where provided for in a written agreement between this e-mail addressee and the Company. If you are not an intended recipient(s), please notify the sender promptly and destroy this message and its attachments without reading or saving it in any manner. Any non authorized use of the content of this message constitutes a violation of the obligation to abstain from learning of the correspondence among other subjects, except for more serious offence, and exposes the person responsible to the relevant consequences. _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python