Path: csiph.com!feeder.erje.net!2.eu.feeder.erje.net!ecngs!feeder2.ecngs.de!81.171.118.61.MISMATCH!peer01.fr7!futter-mich.highwinds-media.com!news.highwinds-media.com!fx30.am4.POSTED!not-for-mail Received-SPF: none (Address does not pass the Sender Policy Framework) SPF=MAILFROM; sender=python@vogl.cz; remoteip=::ffff:91.232.213.5; remotehost=; helo=smtp.muvb.cz; receiver=hugo.zagamma.cz; Reply-To: python@vogl.cz From: Lubomir Vogl User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: none (Address does not pass the Sender Policy Framework) SPF=FROM; sender=python@vogl.cz; remoteip=::ffff:91.232.213.5; remotehost=; helo=smtp.muvb.cz; receiver=hugo.zagamma.cz; Subject: [python] par dotazu od zacatecnika v SQL X-BeenThere: python@py.cz X-Mailman-Version: 2.1.24 Precedence: list List-Id: Konference PyCZ List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: cz.comp.lang.python Message-ID: X-Mailman-Original-Message-ID: <1e5933fa-c491-ea01-9205-c5bb4d2cfc9d@vogl.cz> References: <1e5933fa-c491-ea01-9205-c5bb4d2cfc9d@vogl.cz> Lines: 23 X-Complaints-To: abuse@usenet-news.net NNTP-Posting-Date: Mon, 25 Dec 2017 10:41:45 UTC Organization: usenet-news.net Date: Mon, 25 Dec 2017 11:41:41 +0100 X-Received-Bytes: 2512 X-Received-Body-CRC: 1253049749 Xref: csiph.com cz.comp.lang.python:3223 Ahoj, potreboval bych poradit s SQL. Hraju si s MariaDB a zajimalo by me : - jaka je nejlepsi knihovna pro praci s SQL ? Zatim jsem nasel (PyMySQL, SQLAlchemy, MySqlDb) Chtel bych se naucit neco co bude mozne pouzit i na slozitejsi projekty - je ORM vhodne i na jednodussi projekty ? - pokud budu v SQL chtit pouzivat vice SQL dotazu, je to mozne udelat pres jedno spojeni (jeden cursor) nebo je nutne mit vice otevrenych spojeni ? Viz nasledujici priklad - jedno otevrene spojeni sql = "SELECT * FROM portal WHERE typ_id = " + str(typ) self.cursor.execute(sql) data = self.cursor.fetchall() c = self.cursor.rowcount for row in data: sql1 = "INSERT INTO values VALUES ('',NOW(),0," + str(row[0]) + ")" try: self.cursor.execute(sql1) except: self.db.rollback()