Re: [sqlalchemy] Should I use a surrogate primary key on an Association Object pattern?

2023-07-03 Thread 'Michael Mulqueen' via sqlalchemy
Hi Pierre, This isn't an official answer, I'm just a long time user of SQLAlchemy. Either way should work fine. The association object is driven by the columns on the association table being FKs, whether or not they're part of a PK isn't relevant. I've used both ways. In my experience, an artifi

Re: [sqlalchemy] Implementing Role-Based Access Control (RBAC) in SQLAlchemy with oso

2021-01-07 Thread 'Michael Mulqueen' via sqlalchemy
Thanks for sharing this. Will take a good look at it, I've been looking for something like this. There's a broken link on the text "guide to roles patterns ". On Thu, 7 Jan 2021, 18:15 Stephie Glaser, wrote: > Hi all, we

Re: [sqlalchemy] How to disable the integer col + pk = serial behaviour?

2020-08-05 Thread 'Michael Mulqueen' via sqlalchemy
ttps://groups.google.com/d/msgid/sqlalchemy/7860f5ab-64a4-481d-8e72-9b40d2ab2527o%40googlegroups.com > <https://groups.google.com/d/msgid/sqlalchemy/7860f5ab-64a4-481d-8e72-9b40d2ab2527o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Michael Mulqueen *Method

Re: [sqlalchemy] How can I query two fields in my database to confirm it exists and then delete

2020-08-04 Thread &#x27;Michael Mulqueen' via sqlalchemy
.com/d/msgid/sqlalchemy/85301330-9208-4f8e-b1d4-e89ea8942239o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Michael Mulqueen *Method B Ltd* m...@method-b.uk / +44 (0)330 223 0864 http://www.method-b.uk/ Method B Limited is registered in England and Wales with the

Re: [sqlalchemy] session.add with insert-or-update

2020-03-07 Thread &#x27;Michael Mulqueen' via sqlalchemy
Hi Keith, Small world! You have at least 3 options depending on your requirements: 1. Handle it in your own application logic (e.g. make a get_or_create method) - I tend to prefer this, business rules for create vs. update often creeps in. 2. Use session.merge https://docs.sqlalchemy.org/en/13/o