Thanks Laurent and Michael. 

I want to avoid using *SQLALCHEMY* all together really to have a better 
understanding of how things work inside pyramid for integrating the tool 
with other tools already in place. so I think that is the correct route. 
once I get this to work , I will have a deeper understanding of pyramid in 
general which will help integrating that tool into the system we already 
have in place .

thanks a lot for the input, I appreciate everyone's time. 





On Thursday, August 11, 2022 at 7:38:36 PM UTC+3 [email protected] wrote:

> As Laurent said, if I were starting from scratch a new project I would 
> personally use the pyramid-cookiecutter-starter sqlalchemy and then rip out 
> what I didn’t need but only one part of that cookie cutter is the ORM. It 
> has several other features that you need to solve one way or another so 
> you’d at least want to know what you’re getting rid of. It is modular and 
> you can pick the layers you want.
>
> - connection pooling
> - transaction binding to request lifecycle to rollback or commit at 
> optimal times
> - tables mappings to assist in converting database types into python
> - ORM objects a more comprehensive query language on top of those tables
> - alembic for autogenerating migrations from those models and helping with 
> database versioning
>
> If you go with only the first couple layers you can rip the rest out and 
> just use dbsession.execute() like you would in psycopg2 and just set the 
> zope.sqlalchemy initial_state=‘changed’. 
>
> You can accomplish everything done here without sqlalchemy as well - but 
> you will still want to understand the layers and reasons for the 
> fundamental patterns to hook into pyramid. The sqlalchemy part of the 
> config can be replaced almost directly with psycopg2 versions of everything 
> and it just ends up being more specific to that application. You will need 
> to use the cookbook entries to manage your connections/transactions as I 
> don’t think there’s a pyramid_tm binding for psycopg2 directly - although 
> it’s likely easy to write that DataManager. 
>
> - Michael
>
> On Aug 11, 2022, at 09:25, Eldav <[email protected]> wrote:
>
> 
>
> sorry, database *abstraction* (stupid typo)
>
>
> Le jeudi 11 août 2022 à 18:22:07 UTC+2, Eldav a écrit :
>
>> Hello,
>>
>> afaik, nothing forces you to use SQLAlchemy with Pyramid (after all, you 
>> could decide to use a non-relational database such as the ZODB or MongoDB). 
>>
>> If you are sure that you won't need database attraction later, you can 
>> talk to psycopg2/3 directly. By doing so, you will also lose the 
>> possibility to automatically synchronise SQL transactions with Pyramid. It 
>> may or may not be ok for you, depending on your problem, but it's certainly 
>> possible to implement the required mechanism if required.
>>
>> On the other hand, you might decide to run your raw SQL queries via 
>> SQLAlchemy, without using the ORM parts. This would give you the 
>> transaction synchronisation, provided you remember to mark your DB session 
>> as changed (look for "mark_changed" in 
>> https://pypi.org/project/zope.sqlalchemy/#full-example) after an 
>> insert/update/delete query.
>>
>> Hope this helps,
>>
>> Laurent.
>>
>> Le jeudi 11 août 2022 à 17:53:31 UTC+2, [email protected] a écrit :
>>
>>> Hello , 
>>>
>>> I am building an application ( more of a tool really ) that have a web 
>>> interface , and I am trying to avoid using ORM all together. plus I want to 
>>> try postgresql features and experiment more with them.
>>>
>>> I don't want things to be overly complicated on the web interface so I 
>>> put lots of logic , *something that I know will not change any time 
>>> soon* , into PostgreSQL directly using functions etc.
>>>
>>> can you please point me to the right direction of using pyramid without 
>>> it ? what might be the pitfalls of not using an ORM with pyramid  ?
>>>
>>>
>>>
>>> Thanks !
>>>
>> -- 
>
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pylons-discuss/d1ab4b3d-48be-48d4-aafb-1cc9cc2ef1b5n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/pylons-discuss/d1ab4b3d-48be-48d4-aafb-1cc9cc2ef1b5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/17e89621-1f04-461f-b306-8ddd5f7513bfn%40googlegroups.com.

Reply via email to