Re: [sqlalchemy] Lose the schema??

2021-06-21 Thread Mike Bayer
https://github.com/sqlalchemy/sqlalchemy/issues/6658 will be fixed in the next 
release

though your program should not have to use the IDENTITY INSERT feature and we 
need to see your schema / Table.



On Mon, Jun 21, 2021, at 5:57 PM, Mike Bayer wrote:
> OK more specifically you seem to be using the "schema_translate_map" feature 
> and  but for some reason SQLAlchemy is also  attempting to manipulate the 
> IDENTITY INSERT feature, which normally should not be happening, and in this 
> case it appears there may be a bug in the SQL Server dialect that does not 
> correctly combine "schema_translate_map" with IDENTITY INSERT.
> 
> however there is no reason IDENTITY INSERT should be changing here, I would 
> need to see the "CREATE TABLE" for this table as well as what your Table 
> metadata looks like.
> 
> 
> 
> 
> On Mon, Jun 21, 2021, at 5:50 PM, Mike Bayer wrote:
>> you have a Table that defines "schema" as "SCHEMA__none", and this schema 
>> does not exist.
>> 
>> Schema definition is described at 
>> https://docs.sqlalchemy.org/en/14/core/metadata.html#specifying-the-schema-name
>>   .
>> 
>> 
>> 
>> On Mon, Jun 21, 2021, at 4:34 PM, Victor Manuel Arévalo Fandiño wrote:
>>> Hello
>>> 
>>> I'm trying to insert a row in a table but I have the message:
>>> "No se pudo realizar el insert en Tbl_cataloging_meeting:(>> 'sqlalchemy.exc.ProgrammingError'>, 
>>> ProgrammingError('(pypyodbc.ProgrammingError) (\'42000\', \'[42000] 
>>> [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot find the 
>>> object "SCHEMA__none.tbl_cataloging_meeting" because it does not exist or 
>>> you do not have permissions.\')'), >> 0x02393E47B540>)"
>>> I don't understand the reason of this message because I can write in other 
>>> table before, this is a fragment of my code:
>>> 
>>> def make_inserts(self):
>>> self.insert_tbl_act_template(self.list_tbl_act_template)
>>> self.insert_tbl_cataloging_meeting(self.list_tbl_cataloging_meeting)
>>> -
>>> def insert_tbl_cataloging_meeting(self, cataloging_meeting_register):
>>> try:
>>> if cataloging_meeting_register is not None:
>>> self.__session.add(cataloging_meeting_register)
>>> self.__session.commit()
>>> return cataloging_meeting_register
>>> except:
>>> mesagge = "No se pudo realizar el insert en Tbl_cataloging_meeting:" + 
>>> str(sys.exc_info())
>>> print(mesagge)
>>> return None
>>> 
>>> When call self.insert_tbl_act_template the insert is commited but 
>>> self.insert_tbl_cataloging_meeting doesn't work. Really I don't understand 
>>> the problemm.
>>> the echo of sqlalchemy show me this:
>>> 
>>> 
>>> 2021-06-21 15:05:31,235 INFO sqlalchemy.engine.Engine INSERT INTO 
>>> [PRESIDENCY_DATA].tbl_act_template (ate_name, ate_description, ate_resume, 
>>> ate_type_field, ate_is_valid, ate_created_at, ate_updated_at, 
>>> ate_deleted_at, ate_creator_id, ate_updater_id, ate_deleter_id, ate_file) 
>>> OUTPUT inserted.ate_id VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
>>> 2021-06-21 15:05:31,235 INFO sqlalchemy.engine.Engine [generated in 
>>> 0.00151s] ('City Council meeting minutes', 'City Council meeting minutes', 
>>> None, None, 0, datetime.datetime(2020, 8, 17, 8, 28, 55, 56), 
>>> datetime.datetime(2020, 8, 17, 8, 28, 55, 56), datetime.datetime(2020, 
>>> 8, 24, 16, 40, 22, 37), 1167, 1167, 1167, 'Plantilla Acta.rdlx')
>>> 2021-06-21 15:05:31,241 INFO sqlalchemy.engine.Engine COMMIT
>>> 2021-06-21 15:05:31,245 INFO sqlalchemy.engine.Engine BEGIN (implicit)
>>> 2021-06-21 15:05:31,250 INFO sqlalchemy.engine.Engine SELECT 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_id AS tbl_act_template_ate_id, 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_name AS tbl_act_template_ate_name, 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_description AS 
>>> tbl_act_template_ate_description, 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_resume AS 
>>> tbl_act_template_ate_resume, 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_type_field AS 
>>> tbl_act_template_ate_type_field, 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_is_valid AS 
>>> tbl_act_template_ate_is_valid, 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_created_at AS 
>>> tbl_act_template_ate_created_at, 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_updated_at AS 
>>> tbl_act_template_ate_updated_at, 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_deleted_at AS 
>>> tbl_act_template_ate_deleted_at, 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_creator_id AS 
>>> tbl_act_template_ate_creator_id, 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_updater_id AS 
>>> tbl_act_template_ate_updater_id, 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_deleter_id AS 
>>> tbl_act_template_ate_deleter_id, 
>>> [PRESIDENCY_DATA].tbl_act_template.ate_file AS tbl_act_template_ate_file 
>>> FROM [PRESIDENCY_DATA].tbl_act_template 
>>> WHERE [PRESIDENCY_DATA].tbl_act_template.ate_id = ?
>>> 2021-06-21 15:05:31,250 INFO sqlalchemy.engine.Engine [generated in 
>>> 0.00039s] (59,)

Re: [sqlalchemy] Lose the schema??

2021-06-21 Thread Mike Bayer
OK more specifically you seem to be using the "schema_translate_map" feature 
and  but for some reason SQLAlchemy is also  attempting to manipulate the 
IDENTITY INSERT feature, which normally should not be happening, and in this 
case it appears there may be a bug in the SQL Server dialect that does not 
correctly combine "schema_translate_map" with IDENTITY INSERT.

however there is no reason IDENTITY INSERT should be changing here, I would 
need to see the "CREATE TABLE" for this table as well as what your Table 
metadata looks like.




On Mon, Jun 21, 2021, at 5:50 PM, Mike Bayer wrote:
> you have a Table that defines "schema" as "SCHEMA__none", and this schema 
> does not exist.
> 
> Schema definition is described at 
> https://docs.sqlalchemy.org/en/14/core/metadata.html#specifying-the-schema-name
>   .
> 
> 
> 
> On Mon, Jun 21, 2021, at 4:34 PM, Victor Manuel Arévalo Fandiño wrote:
>> Hello
>> 
>> I'm trying to insert a row in a table but I have the message:
>> "No se pudo realizar el insert en Tbl_cataloging_meeting:(> 'sqlalchemy.exc.ProgrammingError'>, 
>> ProgrammingError('(pypyodbc.ProgrammingError) (\'42000\', \'[42000] 
>> [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot find the object 
>> "SCHEMA__none.tbl_cataloging_meeting" because it does not exist or you do 
>> not have permissions.\')'), )"
>> I don't understand the reason of this message because I can write in other 
>> table before, this is a fragment of my code:
>> 
>> def make_inserts(self):
>> self.insert_tbl_act_template(self.list_tbl_act_template)
>> self.insert_tbl_cataloging_meeting(self.list_tbl_cataloging_meeting)
>> -
>> def insert_tbl_cataloging_meeting(self, cataloging_meeting_register):
>> try:
>> if cataloging_meeting_register is not None:
>> self.__session.add(cataloging_meeting_register)
>> self.__session.commit()
>> return cataloging_meeting_register
>> except:
>> mesagge = "No se pudo realizar el insert en Tbl_cataloging_meeting:" + 
>> str(sys.exc_info())
>> print(mesagge)
>> return None
>> 
>> When call self.insert_tbl_act_template the insert is commited but 
>> self.insert_tbl_cataloging_meeting doesn't work. Really I don't understand 
>> the problemm.
>> the echo of sqlalchemy show me this:
>> 
>> 
>> 2021-06-21 15:05:31,235 INFO sqlalchemy.engine.Engine INSERT INTO 
>> [PRESIDENCY_DATA].tbl_act_template (ate_name, ate_description, ate_resume, 
>> ate_type_field, ate_is_valid, ate_created_at, ate_updated_at, 
>> ate_deleted_at, ate_creator_id, ate_updater_id, ate_deleter_id, ate_file) 
>> OUTPUT inserted.ate_id VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
>> 2021-06-21 15:05:31,235 INFO sqlalchemy.engine.Engine [generated in 
>> 0.00151s] ('City Council meeting minutes', 'City Council meeting minutes', 
>> None, None, 0, datetime.datetime(2020, 8, 17, 8, 28, 55, 56), 
>> datetime.datetime(2020, 8, 17, 8, 28, 55, 56), datetime.datetime(2020, 
>> 8, 24, 16, 40, 22, 37), 1167, 1167, 1167, 'Plantilla Acta.rdlx')
>> 2021-06-21 15:05:31,241 INFO sqlalchemy.engine.Engine COMMIT
>> 2021-06-21 15:05:31,245 INFO sqlalchemy.engine.Engine BEGIN (implicit)
>> 2021-06-21 15:05:31,250 INFO sqlalchemy.engine.Engine SELECT 
>> [PRESIDENCY_DATA].tbl_act_template.ate_id AS tbl_act_template_ate_id, 
>> [PRESIDENCY_DATA].tbl_act_template.ate_name AS tbl_act_template_ate_name, 
>> [PRESIDENCY_DATA].tbl_act_template.ate_description AS 
>> tbl_act_template_ate_description, 
>> [PRESIDENCY_DATA].tbl_act_template.ate_resume AS 
>> tbl_act_template_ate_resume, 
>> [PRESIDENCY_DATA].tbl_act_template.ate_type_field AS 
>> tbl_act_template_ate_type_field, 
>> [PRESIDENCY_DATA].tbl_act_template.ate_is_valid AS 
>> tbl_act_template_ate_is_valid, 
>> [PRESIDENCY_DATA].tbl_act_template.ate_created_at AS 
>> tbl_act_template_ate_created_at, 
>> [PRESIDENCY_DATA].tbl_act_template.ate_updated_at AS 
>> tbl_act_template_ate_updated_at, 
>> [PRESIDENCY_DATA].tbl_act_template.ate_deleted_at AS 
>> tbl_act_template_ate_deleted_at, 
>> [PRESIDENCY_DATA].tbl_act_template.ate_creator_id AS 
>> tbl_act_template_ate_creator_id, 
>> [PRESIDENCY_DATA].tbl_act_template.ate_updater_id AS 
>> tbl_act_template_ate_updater_id, 
>> [PRESIDENCY_DATA].tbl_act_template.ate_deleter_id AS 
>> tbl_act_template_ate_deleter_id, [PRESIDENCY_DATA].tbl_act_template.ate_file 
>> AS tbl_act_template_ate_file 
>> FROM [PRESIDENCY_DATA].tbl_act_template 
>> WHERE [PRESIDENCY_DATA].tbl_act_template.ate_id = ?
>> 2021-06-21 15:05:31,250 INFO sqlalchemy.engine.Engine [generated in 
>> 0.00039s] (59,)
>> 2021-06-21 15:05:37,829 INFO sqlalchemy.engine.Engine SET IDENTITY_INSERT 
>> [SCHEMA__none].tbl_cataloging_meeting ON
>> 2021-06-21 15:05:37,829 INFO sqlalchemy.engine.Engine ()
>> 2021-06-21 15:05:37,830 INFO sqlalchemy.engine.Engine ROLLBACK
>> No se pudo realizar el insert en Tbl_cataloging_meeting:(> 'sqlalchemy.exc.ProgrammingError'>, 
>> 

Re: [sqlalchemy] Lose the schema??

2021-06-21 Thread Mike Bayer
you have a Table that defines "schema" as "SCHEMA__none", and this schema does 
not exist.

Schema definition is described at 
https://docs.sqlalchemy.org/en/14/core/metadata.html#specifying-the-schema-name 
 .



On Mon, Jun 21, 2021, at 4:34 PM, Victor Manuel Arévalo Fandiño wrote:
> Hello
> 
> I'm trying to insert a row in a table but I have the message:
> "No se pudo realizar el insert en Tbl_cataloging_meeting:( 'sqlalchemy.exc.ProgrammingError'>, 
> ProgrammingError('(pypyodbc.ProgrammingError) (\'42000\', \'[42000] 
> [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot find the object 
> "SCHEMA__none.tbl_cataloging_meeting" because it does not exist or you do not 
> have permissions.\')'), )"
> I don't understand the reason of this message because I can write in other 
> table before, this is a fragment of my code:
> 
> def make_inserts(self):
> self.insert_tbl_act_template(self.list_tbl_act_template)
> self.insert_tbl_cataloging_meeting(self.list_tbl_cataloging_meeting)
> -
> def insert_tbl_cataloging_meeting(self, cataloging_meeting_register):
> try:
> if cataloging_meeting_register is not None:
> self.__session.add(cataloging_meeting_register)
> self.__session.commit()
> return cataloging_meeting_register
> except:
> mesagge = "No se pudo realizar el insert en Tbl_cataloging_meeting:" + 
> str(sys.exc_info())
> print(mesagge)
> return None
> 
> When call self.insert_tbl_act_template the insert is commited but 
> self.insert_tbl_cataloging_meeting doesn't work. Really I don't understand 
> the problemm.
> the echo of sqlalchemy show me this:
> 
> 
> 2021-06-21 15:05:31,235 INFO sqlalchemy.engine.Engine INSERT INTO 
> [PRESIDENCY_DATA].tbl_act_template (ate_name, ate_description, ate_resume, 
> ate_type_field, ate_is_valid, ate_created_at, ate_updated_at, ate_deleted_at, 
> ate_creator_id, ate_updater_id, ate_deleter_id, ate_file) OUTPUT 
> inserted.ate_id VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
> 2021-06-21 15:05:31,235 INFO sqlalchemy.engine.Engine [generated in 0.00151s] 
> ('City Council meeting minutes', 'City Council meeting minutes', None, None, 
> 0, datetime.datetime(2020, 8, 17, 8, 28, 55, 56), datetime.datetime(2020, 
> 8, 17, 8, 28, 55, 56), datetime.datetime(2020, 8, 24, 16, 40, 22, 
> 37), 1167, 1167, 1167, 'Plantilla Acta.rdlx')
> 2021-06-21 15:05:31,241 INFO sqlalchemy.engine.Engine COMMIT
> 2021-06-21 15:05:31,245 INFO sqlalchemy.engine.Engine BEGIN (implicit)
> 2021-06-21 15:05:31,250 INFO sqlalchemy.engine.Engine SELECT 
> [PRESIDENCY_DATA].tbl_act_template.ate_id AS tbl_act_template_ate_id, 
> [PRESIDENCY_DATA].tbl_act_template.ate_name AS tbl_act_template_ate_name, 
> [PRESIDENCY_DATA].tbl_act_template.ate_description AS 
> tbl_act_template_ate_description, 
> [PRESIDENCY_DATA].tbl_act_template.ate_resume AS tbl_act_template_ate_resume, 
> [PRESIDENCY_DATA].tbl_act_template.ate_type_field AS 
> tbl_act_template_ate_type_field, 
> [PRESIDENCY_DATA].tbl_act_template.ate_is_valid AS 
> tbl_act_template_ate_is_valid, 
> [PRESIDENCY_DATA].tbl_act_template.ate_created_at AS 
> tbl_act_template_ate_created_at, 
> [PRESIDENCY_DATA].tbl_act_template.ate_updated_at AS 
> tbl_act_template_ate_updated_at, 
> [PRESIDENCY_DATA].tbl_act_template.ate_deleted_at AS 
> tbl_act_template_ate_deleted_at, 
> [PRESIDENCY_DATA].tbl_act_template.ate_creator_id AS 
> tbl_act_template_ate_creator_id, 
> [PRESIDENCY_DATA].tbl_act_template.ate_updater_id AS 
> tbl_act_template_ate_updater_id, 
> [PRESIDENCY_DATA].tbl_act_template.ate_deleter_id AS 
> tbl_act_template_ate_deleter_id, [PRESIDENCY_DATA].tbl_act_template.ate_file 
> AS tbl_act_template_ate_file 
> FROM [PRESIDENCY_DATA].tbl_act_template 
> WHERE [PRESIDENCY_DATA].tbl_act_template.ate_id = ?
> 2021-06-21 15:05:31,250 INFO sqlalchemy.engine.Engine [generated in 0.00039s] 
> (59,)
> 2021-06-21 15:05:37,829 INFO sqlalchemy.engine.Engine SET IDENTITY_INSERT 
> [SCHEMA__none].tbl_cataloging_meeting ON
> 2021-06-21 15:05:37,829 INFO sqlalchemy.engine.Engine ()
> 2021-06-21 15:05:37,830 INFO sqlalchemy.engine.Engine ROLLBACK
> No se pudo realizar el insert en Tbl_cataloging_meeting:( 'sqlalchemy.exc.ProgrammingError'>, 
> ProgrammingError('(pypyodbc.ProgrammingError) (\'42000\', \'[42000] 
> [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot find the object 
> "SCHEMA__none.tbl_cataloging_meeting" because it does not exist or you do not 
> have permissions.\')'), )
> 
> I appreciate some help.
> 
> best regards
> Víctor Manuel Arévalo Fandiño
> 
> 

> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
>  
> http://www.sqlalchemy.org/
>  
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe 

[sqlalchemy] Re: checking in

2021-06-21 Thread 'Jonathan Vanasco' via sqlalchemy
> If not I wonder why messages aren't arriving in my INBOX.

Check your settings for this group.  If you do not see the option on the 
menu, try visiting https://groups.google.com/g/sqlalchemy/membership

Google sometimes has a product change de-selects the email delivery 
option.  Sometimes users de-select email delivery and forget about that too.


On Monday, June 14, 2021 at 5:25:47 PM UTC-4 rshe...@appl-ecosys.com wrote:

> I've not worked with SQLAlchemy for several years but now want to use it in
> a couple of applications. I've not seen messages on this maillist for a 
> very
> long time so I tried subscribing and learned that I'm still subscribed.
>
> Am I the only one on this list now?
>
> If not I wonder why messages aren't arriving in my INBOX.
>
> Rich
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/b9f2ec03-8dff-4796-b1a3-2efc4409729en%40googlegroups.com.


[sqlalchemy] Lose the schema??

2021-06-21 Thread Victor Manuel Arévalo Fandiño
Hello

I'm trying to insert a row in a table but I have the message:
"No se pudo realizar el insert en Tbl_cataloging_meeting:(, 
ProgrammingError('(pypyodbc.ProgrammingError) (\'42000\', \'[42000] 
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot find the 
object "SCHEMA__none.tbl_cataloging_meeting" because it does not exist or 
you do not have permissions.\')'), )"
I don't understand the reason of this message because I can write in other 
table before, this is a fragment of my code:

def make_inserts(self):
self.insert_tbl_act_template(self.list_tbl_act_template)
self.insert_tbl_cataloging_meeting(self.list_tbl_cataloging_meeting)
-
def insert_tbl_cataloging_meeting(self, cataloging_meeting_register):
try:
if cataloging_meeting_register is not None:
self.__session.add(cataloging_meeting_register)
self.__session.commit()
return cataloging_meeting_register
except:
mesagge = "No se pudo realizar el insert en Tbl_cataloging_meeting:" + str
(sys.exc_info())
print(mesagge)
return None

When call self.insert_tbl_act_template the insert is commited but self
.insert_tbl_cataloging_meeting doesn't work. Really I don't understand the 
problemm.
the echo of sqlalchemy show me this:

2021-06-21 15:05:31,235 INFO sqlalchemy.engine.Engine INSERT INTO 
[PRESIDENCY_DATA].tbl_act_template (ate_name, ate_description, ate_resume, 
ate_type_field, ate_is_valid, ate_created_at, ate_updated_at, 
ate_deleted_at, ate_creator_id, ate_updater_id, ate_deleter_id, ate_file) 
OUTPUT inserted.ate_id VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2021-06-21 15:05:31,235 INFO sqlalchemy.engine.Engine [generated in 
0.00151s] ('City Council meeting minutes', 'City Council meeting minutes', 
None, None, 0, datetime.datetime(2020, 8, 17, 8, 28, 55, 56), 
datetime.datetime(2020, 8, 17, 8, 28, 55, 56), datetime.datetime(2020, 
8, 24, 16, 40, 22, 37), 1167, 1167, 1167, 'Plantilla Acta.rdlx')
2021-06-21 15:05:31,241 INFO sqlalchemy.engine.Engine COMMIT
2021-06-21 15:05:31,245 INFO sqlalchemy.engine.Engine BEGIN (implicit)
2021-06-21 15:05:31,250 INFO sqlalchemy.engine.Engine SELECT 
[PRESIDENCY_DATA].tbl_act_template.ate_id AS tbl_act_template_ate_id, 
[PRESIDENCY_DATA].tbl_act_template.ate_name AS tbl_act_template_ate_name, 
[PRESIDENCY_DATA].tbl_act_template.ate_description AS 
tbl_act_template_ate_description, 
[PRESIDENCY_DATA].tbl_act_template.ate_resume AS 
tbl_act_template_ate_resume, 
[PRESIDENCY_DATA].tbl_act_template.ate_type_field AS 
tbl_act_template_ate_type_field, 
[PRESIDENCY_DATA].tbl_act_template.ate_is_valid AS 
tbl_act_template_ate_is_valid, 
[PRESIDENCY_DATA].tbl_act_template.ate_created_at AS 
tbl_act_template_ate_created_at, 
[PRESIDENCY_DATA].tbl_act_template.ate_updated_at AS 
tbl_act_template_ate_updated_at, 
[PRESIDENCY_DATA].tbl_act_template.ate_deleted_at AS 
tbl_act_template_ate_deleted_at, 
[PRESIDENCY_DATA].tbl_act_template.ate_creator_id AS 
tbl_act_template_ate_creator_id, 
[PRESIDENCY_DATA].tbl_act_template.ate_updater_id AS 
tbl_act_template_ate_updater_id, 
[PRESIDENCY_DATA].tbl_act_template.ate_deleter_id AS 
tbl_act_template_ate_deleter_id, 
[PRESIDENCY_DATA].tbl_act_template.ate_file AS tbl_act_template_ate_file 
FROM [PRESIDENCY_DATA].tbl_act_template 
WHERE [PRESIDENCY_DATA].tbl_act_template.ate_id = ?
2021-06-21 15:05:31,250 INFO sqlalchemy.engine.Engine [generated in 
0.00039s] (59,)
2021-06-21 15:05:37,829 INFO sqlalchemy.engine.Engine SET IDENTITY_INSERT 
[SCHEMA__none].tbl_cataloging_meeting ON
2021-06-21 15:05:37,829 INFO sqlalchemy.engine.Engine ()
2021-06-21 15:05:37,830 INFO sqlalchemy.engine.Engine ROLLBACK
No se pudo realizar el insert en Tbl_cataloging_meeting:(, 
ProgrammingError('(pypyodbc.ProgrammingError) (\'42000\', \'[42000] 
[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot find the 
object "SCHEMA__none.tbl_cataloging_meeting" because it does not exist or 
you do not have permissions.\')'), )

I appreciate some help.

best regards
Víctor Manuel Arévalo Fandiño

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/08bbdecf-4468-45f0-8f22-d50188c3747fn%40googlegroups.com.


Re: [sqlalchemy] migrating to 1.4 and sql.and_()

2021-06-21 Thread Mike Bayer
hi -

can you please create a self-contained MCVE and post to 
https://github.com/sqlalchemy/sqlalchemy/issues - thanks.

- mike



On Mon, Jun 21, 2021, at 5:25 AM, Julien Cigar wrote:
> ok .. :) 
> 
> Another regression from 1.3: I have two deferred column_property on my
> mapped class (1) and with (2) I'm getting a
> sqlalchemy.exc.ProgrammingError: sqlalchemy.exc.ProgrammingError:
> (psycopg2.errors.InvalidColumnReference) WITH query "parents" has 21
> columns available but 23 columns specified.
> 
> The generated query is (3), which is wrong: it includes deferred columns
> in the WITH RECUSRIVE statement but don't load them in the SELECT
> clause. If I'm set deferred=False in (1) then is works as expected
> (generated query is (4))
> 
> (1) 
> https://github.com/silenius/amnesia/blob/dev/amnesia/modules/content/mapper.py#L117-L130
> (2) https://gist.github.com/silenius/34ce40ed288c6a681058ab064147bd70
> (3) https://gist.github.com/silenius/02a8c2481f77ca1a1ec05bfad830821d
> (4) https://gist.github.com/silenius/5de95ceddd14e62bfc3e52366643bd32
> 
> Julien
> 
> On Fri, Jun 18, 2021 at 10:11:10AM -0400, Mike Bayer wrote:
> > 
> > that's a really obscure API you found there. Coverage for that wasn't 
> > carried along to 1.4 unfortunately so you'd need to assemble that list 
> > outside of the and_() first for now. 
> > 
> > 
> > On Fri, Jun 18, 2021, at 4:08 AM, Julien Cigar wrote:
> > > Hello,
> > > 
> > > While updating SQLAlchemy dependency to 1.4 (from 1.3) I noticed that I
> > > couldn't use .append() on an existing sql.and_() clause .. is it
> > > expected..?
> > > 
> > > The problematic code is
> > > https://gist.github.com/silenius/7d3043d64fddaa8474dcd062e23ced44 (line
> > > 18-21)
> > > 
> > > Another example that worked with 1.3: 
> > > https://gist.github.com/silenius/2054e7dc690946c0122c72e6b05f1433
> > > 
> > > Thanks,
> > > Julien
> > > 
> > > -- 
> > > Julien Cigar
> > > Belgian Biodiversity Platform (http://www.biodiversity.be)
> > > PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
> > > No trees were killed in the creation of this message.
> > > However, many electrons were terribly inconvenienced.
> > > 
> > > -- 
> > > SQLAlchemy - 
> > > The Python SQL Toolkit and Object Relational Mapper
> > > 
> > > http://www.sqlalchemy.org/
> > > 
> > > To post example code, please provide an MCVE: Minimal, Complete, and 
> > > Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> > > description.
> > > --- 
> > > You received this message because you are subscribed to the Google Groups 
> > > "sqlalchemy" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to sqlalchemy+unsubscr...@googlegroups.com 
> > >  
> > > .
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/sqlalchemy/20210618080804.b47v72c3whdaluyh%40x1.
> > > 
> > 
> > -- 
> > SQLAlchemy - 
> > The Python SQL Toolkit and Object Relational Mapper
> > 
> > http://www.sqlalchemy.org/
> > 
> > To post example code, please provide an MCVE: Minimal, Complete, and 
> > Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> > description.
> > --- 
> > You received this message because you are subscribed to the Google Groups 
> > "sqlalchemy" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to sqlalchemy+unsubscr...@googlegroups.com 
> > .
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/sqlalchemy/31f1f804-21f2-4faa-9a71-ef356149248a%40www.fastmail.com.
> 
> -- 
> Julien Cigar
> Belgian Biodiversity Platform (http://www.biodiversity.be)
> PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
> No trees were killed in the creation of this message.
> However, many electrons were terribly inconvenienced.
> 
> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/20210621092524.pzzpcnn5nkuxsr6y%40x1.
> 

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You 

Re: [sqlalchemy] In the onupdate function, how to get the value of the row of records to be updated

2021-06-21 Thread Simon King
I don't think you'll be able to get what you want in an onupdate
function. You'd probably be better off with the before_insert and
before_update mapper events:

https://docs.sqlalchemy.org/en/14/orm/events.html#sqlalchemy.orm.MapperEvents.before_insert

https://docs.sqlalchemy.org/en/14/orm/events.html#sqlalchemy.orm.MapperEvents.before_update

Hope that helps,

Simon

On Sun, Jun 20, 2021 at 5:37 PM peizhi qin  wrote:
>
> I have a table ,the definition is as follows:
> class TEnterprise(Base):
> __tablename__ = 't_enterprise'
> __table_args__ = (
> {'mysql_engine': 'InnoDB', 'mysql_charset': 'latin1'}
> )
>
> Fent_id = Column(String(32), primary_key=True)
> Fent_type = Column(INTEGER(11), nullable=False)
> Fcomb_cert_state = Column(INTEGER(11), nullable=False)
> Fstate = Column(INTEGER(11), nullable=False)
> Fbusiness_license_copy = Column(String(256), nullable=False)
> Fbusiness_license_number = Column(String(32), nullable=False)
> Fmerchant_name = Column(String(128), nullable=False)
> Fsign = Column(String(64), nullable=False, server_default=text("''"))
>
> the Fsign=md5(Fcomb_cert_state=${Fcomb_cert_state}_id=${Fent_id})
>
> i can use  context.current_parameters get the value of the field to be 
> updated, but how to get the value of the field that has not been updated, 
> thanks for help!
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> ---
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/bc9a6c71-90dd-4c7a-a5a8-9712f43d24f6n%40googlegroups.com.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/CAFHwexfwaB5PUdvYj9sGukhtM36iWTc%2B41pG1vMdmV5dYLuVJA%40mail.gmail.com.


Re: [sqlalchemy] migrating to 1.4 and sql.and_()

2021-06-21 Thread Julien Cigar
ok .. :) 

Another regression from 1.3: I have two deferred column_property on my
mapped class (1) and with (2) I'm getting a
sqlalchemy.exc.ProgrammingError: sqlalchemy.exc.ProgrammingError:
(psycopg2.errors.InvalidColumnReference) WITH query "parents" has 21
columns available but 23 columns specified.

The generated query is (3), which is wrong: it includes deferred columns
in the WITH RECUSRIVE statement but don't load them in the SELECT
clause. If I'm set deferred=False in (1) then is works as expected
(generated query is (4))

(1) 
https://github.com/silenius/amnesia/blob/dev/amnesia/modules/content/mapper.py#L117-L130
(2) https://gist.github.com/silenius/34ce40ed288c6a681058ab064147bd70
(3) https://gist.github.com/silenius/02a8c2481f77ca1a1ec05bfad830821d
(4) https://gist.github.com/silenius/5de95ceddd14e62bfc3e52366643bd32

Julien

On Fri, Jun 18, 2021 at 10:11:10AM -0400, Mike Bayer wrote:
> 
> that's a really obscure API you found there. Coverage for that wasn't 
> carried along to 1.4 unfortunately so you'd need to assemble that list 
> outside of the and_() first for now. 
> 
> 
> On Fri, Jun 18, 2021, at 4:08 AM, Julien Cigar wrote:
> > Hello,
> > 
> > While updating SQLAlchemy dependency to 1.4 (from 1.3) I noticed that I
> > couldn't use .append() on an existing sql.and_() clause .. is it
> > expected..?
> > 
> > The problematic code is
> > https://gist.github.com/silenius/7d3043d64fddaa8474dcd062e23ced44 (line
> > 18-21)
> > 
> > Another example that worked with 1.3: 
> > https://gist.github.com/silenius/2054e7dc690946c0122c72e6b05f1433
> > 
> > Thanks,
> > Julien
> > 
> > -- 
> > Julien Cigar
> > Belgian Biodiversity Platform (http://www.biodiversity.be)
> > PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
> > No trees were killed in the creation of this message.
> > However, many electrons were terribly inconvenienced.
> > 
> > -- 
> > SQLAlchemy - 
> > The Python SQL Toolkit and Object Relational Mapper
> > 
> > http://www.sqlalchemy.org/
> > 
> > To post example code, please provide an MCVE: Minimal, Complete, and 
> > Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> > description.
> > --- 
> > You received this message because you are subscribed to the Google Groups 
> > "sqlalchemy" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to sqlalchemy+unsubscr...@googlegroups.com 
> > .
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/sqlalchemy/20210618080804.b47v72c3whdaluyh%40x1.
> > 
> 
> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
> 
> http://www.sqlalchemy.org/
> 
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/31f1f804-21f2-4faa-9a71-ef356149248a%40www.fastmail.com.

-- 
Julien Cigar
Belgian Biodiversity Platform (http://www.biodiversity.be)
PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/20210621092524.pzzpcnn5nkuxsr6y%40x1.


Re: [sqlalchemy] Revert multiple commits using a savepoint

2021-06-21 Thread Simon King
Which version of SQLAlchemy are you using, and how are you creating
your engine? I believe savepoints are handled differently in SA 1.4 if
you are using the "future-style" engine.

Do these doc links help you at all?

https://docs.sqlalchemy.org/en/14/orm/session_transaction.html#nested-transaction

"""
Calling the Session.commit() or Connection.commit() methods will
always commit the outermost transaction; this is a SQLAlchemy 2.0
specific behavior that is reversed from the 1.x series.
"""

https://docs.sqlalchemy.org/en/14/orm/session_transaction.html#session-subtransactions

"""
The “subtransaction” pattern that was often used with autocommit mode
is also deprecated in 1.4. This pattern allowed the use of the
Session.begin() method when a transaction were already begun,
resulting in a construct called a “subtransaction”, which was
essentially a block that would prevent the Session.commit() method
from actually committing.
"""

Simon

On Sat, Jun 19, 2021 at 4:27 PM kaboo HD  wrote:
>
>
> I am trying to test an endpoint in flask and I need to "refresh" the DB after 
> some commits.
>
> The idea I had was something like :
>
> db=SQLAlchemy()
>
> db.session.begin_nested()
>
> db.session.add(Obj)
> db.session.commit()
>
> # some code where last commit is important
>
> db.session.add(Obj2)
> db.session.commit()
>
> # some other code where last commit is important
>
> db.session.rollback()
>
> But it doesn't work unless I have a single commit.
>
> Can you help me please :)
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> ---
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/d77d4621-8f0a-47fd-8e79-ca3de3a4b5edn%40googlegroups.com.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/CAFHwexf7%2Bw7aiSHgcDR5_xenff_m08LTPp%3DyHgGvO-CZu7DREg%40mail.gmail.com.