[sqlalchemy] Re: How to use sqlcodegen generate SQLModels

2023-03-22 Thread Val Huber
You might want to consider API Logic Server 
.  It includes sqlacodegen, and 
uses it to build an executable project including an API and an Admin App.

On Wednesday, March 22, 2023 at 3:55:20 PM UTC-7 Linson Abah wrote:

> Hi,
> I am trying to convert the schema of a db to SQLModels: I have this short 
> script:
>
>
>
>
>
> *from subprocess import calloutfile = 
> 'models/dvdrental_models.py'generator = 'sqlmodels'call(['sqlacodegen', 
> db_uri, '--generator', generator, '--outfile', outfile])*
> I got this Error.
> sqlacodegen: error: unrecognized arguments: --generator sqlmodels
>
> How do I modify this to work correctly? 
>
> Thank you
>
>

-- 
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/e5c9653b-f8be-4c3f-af17-54212ea4b53an%40googlegroups.com.


Re: [sqlalchemy] sqlacodegen giving Unknown database on mysql+pymysql

2023-02-27 Thread Val Huber
Hi, Andy

I share your interest in sqlacodegen.  I am using it heavily in API Logic 
Server,  and did in fact need to 
make some changes.

So, you might want to consider using it.  If all goes well, you'll not only 
get your models.py, you'll get an API and an Admin App.

Hope that helps,
Val

On Friday, February 24, 2023 at 9:01:38 AM UTC-8 Mike Bayer wrote:

> Please refer to https://github.com/agronholm/sqlacodegen/discussions for 
> sqlacodegen support.
>
>
> On Fri, Feb 24, 2023, at 8:12 AM, Andy Andurkar wrote:
>
> I am getting the following error while using sqlcodegen with mysql
> sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1049, 
> "Unknown database 'engine(mysql+pymysql://xxx:***@localhost:3306/mydb)'")
>
> [SQL: SHOW FULL TABLES FROM 
> `Engine(mysql+pymysql://:***@localhost:3306/mydb)`]
>
>
> -- 
> 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+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/5249b369-6c86-4a10-b705-bfd8ad528c61n%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/5f5ac8d8-25d0-4fbb-b28e-b4c6a8046e5bn%40googlegroups.com.


Re: [sqlalchemy] Column vs InstrumentedAttribute

2023-02-23 Thread Val Huber
Yes, Mike, I agree -  definitely seeing correct runtime behavior.

Just looking to get past the somewhat scary alerts (which, btw, do not occur in 
PyCharm).  Care and feeding of the IDE, I suppose…

Not super urgent, but would be good to clear up...

> On Feb 23, 2023, at 7:39 PM, Mike Bayer  
> wrote:
> 
> those are typing issues being reported by Pylance and do not affect the 
> runtime behavior of the application.
> 
> Pylance refers to typing stubs for SQLAlchemy 1.4 which don't apply to 
> SQLAlchemy 1.3.
> 
> 
> 
> On Thu, Feb 23, 2023, at 7:36 PM, Val Huber wrote:
>> Hello, All
>> 
>> In SQLAlchemy 1.4.29, the I get the warnings shown in the attached screen 
>> shot.  These are calls to LogicBank; if I alter LogicBank to use Column 
>> instead of InstrumentedAttribute, it fails with 
>> 
>> AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' 
>> object associated with Customer.Balance has an attribute 'descriptor'
>> 
>> I don't believe I got these warnings with SQLAlchemy 1.3.
>> 
>> Suggestions?
>> 
>> Thanks,
>> Val
>> 
>> 
>> 
>> 
>> -- 
>> 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 
>> <mailto:sqlalchemy+unsubscr...@googlegroups.com>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sqlalchemy/18551662-845e-42d5-acb1-b0ec31140b8fn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/sqlalchemy/18551662-845e-42d5-acb1-b0ec31140b8fn%40googlegroups.com?utm_medium=email_source=footer>.
>> 
>> Attachments:
>> Column vs InstumentedAttribute.png
> 
> 
> -- 
> 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 a topic in the Google 
> Groups "sqlalchemy" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/sqlalchemy/qwj30TCnqzQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> sqlalchemy+unsubscr...@googlegroups.com 
> <mailto:sqlalchemy+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/9c0cedf3-434d-489b-8e60-a9ef68324df1%40app.fastmail.com
>  
> <https://groups.google.com/d/msgid/sqlalchemy/9c0cedf3-434d-489b-8e60-a9ef68324df1%40app.fastmail.com?utm_medium=email_source=footer>.

-- 
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/0F90254D-579D-4218-A8A2-59FE4E65F4E5%40gmail.com.


[sqlalchemy] Re: Column vs InstrumentedAttribute

2023-02-23 Thread Val Huber
The target function looks like this:

class Rule:
"""Invoke these functions to declare rules.

Rules are *not* run as they are defined,
they are run when you issue `session.commit()'.

.. _Rule Summary:
https://github.com/valhuber/LogicBank/wiki/Rule-Summary

Use code completion to discover rules and their parameters.
"""

@staticmethod
def sum(derive: InstrumentedAttribute, as_sum_of: any, where: any = None, 
child_role_name: str = ""):
"""
Derive parent column as sum of designated child column, optional where

Example
Rule.sum(derive=models.Customer.Balance, as_sum_of=models.Order.AmountTotal,
where=Lambda row: row.ShippedDate is None)

Optimized to eliminate / minimize SQLs: Pruning, Adjustment Logic

Args:
derive: name of parent  being derived
as_sum_of: name of child  being summed
child_role_name: parent's child accessor attribute (required only for 
disambiguation)
where: optional where clause, designates which child rows are summed


"""
return Sum(derive, as_sum_of, where, child_role_name)




The model is declared like this:

class Customer(SAFRSBase, Base):
__tablename__ = 'Customer'
_s_collection_name = 'Customer'
__bind_key__ = 'None'

Id = Column(String(8000), primary_key=True)
CompanyName = Column(String(8000))
Balance = Column(DECIMAL)
On Thursday, February 23, 2023 at 4:36:11 PM UTC-8 Val Huber wrote:

> Hello, All
>
> In SQLAlchemy 1.4.29, the I get the warnings shown in the attached screen 
> shot.  These are calls to LogicBank; if I alter LogicBank to use Column 
> instead of InstrumentedAttribute, it fails with 
>
> AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' 
> object associated with Customer.Balance has an attribute 'descriptor'
>
> I don't believe I got these warnings with SQLAlchemy 1.3.
>
> Suggestions?
>
> Thanks,
> Val
>
>
>

-- 
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/34ea2b6f-6921-4245-985a-d4f2a258d7e0n%40googlegroups.com.


[sqlalchemy] Announcement: API Logic Server 8

2023-02-23 Thread Val Huber
Hello, All

If you are using SQLAlchemy and Flask, you might want to take a look at API 
Logic Server (open source).  It reads your schema, and creates an 
executable project you can customize in your IDE.  

The project includes the SQLAlchemy* model classes*, an *API*, and a 
multi-page *Admin App*.  You can also declare spreadsheet-like *rules* for 
multi-table derivations and constraints.

Version 8 adds *authentication* rules, eg, multi-tenant support, using 
outstanding SQLAlchemy support for

 @event.listens_for(session, 'do_orm_execute') 

Eval requires no install / config, using Codespaces, here: 
https://github.com/codespaces/new?hide_repo_select=true=main=593459232
 

Docs are here: https://apilogicserver.github.io/Docs 

Hope you find it useful, grateful for feedback...
Val

-- 
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/c0c3e6b7-b9c4-48b1-b754-17922a386ecfn%40googlegroups.com.


[sqlalchemy] Adding OR () with do_orm_execute

2023-01-11 Thread Val Huber
I am using this and it is working well to AND a series of filters to a 
statement.

But I do not see how to OR these into the original statement.

For example, I have filters f1 and f2.  I want the result to be:

where  AND (f1 OR f2).

Thanks in advance,
Val

-- 
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/69c0c26f-812c-4c0f-b435-c4903ffdf57dn%40googlegroups.com.


Re: [sqlalchemy] Determine transaction after_flush state

2023-01-11 Thread Val Huber
Sounds like session._flushing is exactly what I want… presuming it means “I 
have started flushing, in fact may have flushed any number of times”.

Thanks for the again-quick response, if my presumption is correct, I am all set.

Regards,
Val

> On Jan 11, 2023, at 6:22 PM, Mike Bayer  
> wrote:
> 
> 
> a session can flush any number of times, so what here determines "after" 
> flush state as far as do_orm_execute()? do_orm_execute is not called within 
> the flush itself (well, maybe it is...)
> 
> If you see do_orm_executes inside of the flush, I guess you could look at 
> session._flushing, is that what you are looking for ?
> 
> On Wed, Jan 11, 2023, at 7:44 PM, Val Huber wrote:
>> In API Logic Server, clients can make RESTful requests that cause SQLAlchemy 
>> reads.  These are subjected to authorization security using do_orm_execute 
>> (which is amazing, by the way).  These add filters to ensure proper access.  
>> This is all fine.
>> 
>> But, when the client makes changes, these activate business logic, which 
>> needs to run without auth security.
>> 
>> My question is: how can my do_orm_execute event handler determine we are 
>> in/after after-flush state?  Sorry if I missed them, but I did not find 
>> variables method on session or transaction for this.
>> 
>> Thanks in advance,
>> Val
>> 
>> 
>> -- 
>> 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 
>> <mailto:sqlalchemy+unsubscr...@googlegroups.com>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sqlalchemy/59922a81-8e2c-4575-87c8-e178a99c7a96n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/sqlalchemy/59922a81-8e2c-4575-87c8-e178a99c7a96n%40googlegroups.com?utm_medium=email_source=footer>.
> 
> 
> -- 
> 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 a topic in the Google 
> Groups "sqlalchemy" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/sqlalchemy/kO4zI2r6k0c/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> sqlalchemy+unsubscr...@googlegroups.com 
> <mailto:sqlalchemy+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/d864d888-a058-403b-b25b-315cb16d3158%40app.fastmail.com
>  
> <https://groups.google.com/d/msgid/sqlalchemy/d864d888-a058-403b-b25b-315cb16d3158%40app.fastmail.com?utm_medium=email_source=footer>.

-- 
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/24E9CFA0-2309-4BB6-AA42-B1DBC5833FCF%40gmail.com.


[sqlalchemy] Determine transaction after_flush state

2023-01-11 Thread Val Huber
In API Logic Server, clients can make RESTful requests that 
cause SQLAlchemy reads.  These are subjected to authorization security using 
do_orm_execute (which is amazing, by the way).  These add filters to ensure 
proper access.  This is all fine.

But, when the client makes changes, these activate business logic, which 
needs to run *without* auth security.

My question is: how can my do_orm_execute event handler determine we are 
in/after after-flush state?  Sorry if I missed them, but I did not find 
variables method on session or transaction for this.

Thanks in advance,
Val

-- 
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/59922a81-8e2c-4575-87c8-e178a99c7a96n%40googlegroups.com.


[sqlalchemy] Re: Auto Generate sqlachemy models from yml file or dicts

2022-07-03 Thread Val Huber
Hi, David...

ApiLogicServer  bundles 
a version of sqlacodegen, and creates the models.py file (along with a 
running project).  Don't know if this fits your needs, hope it helps.

On Sunday, July 3, 2022 at 6:15:03 AM UTC-7 david...@gmail.com wrote:

> I want to be able to auto generate sqlalchemy model from a schema.
> So I have the schema in yaml format.
> From that file, I load it and get the columns and its data type  and also 
> the schema name into a dict. And I want to use that dictionary to create 
> the sqlalchemy model  not just a normal python class
>
> I have done some research and I see you can use sqlachemy's automap 
> feature to do what I want but that is when you supply a DB connection uri. 
> Likewise sqlacodegen
>

-- 
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/4cec0f13-2157-4263-ac1e-d298e53a2e8fn%40googlegroups.com.


[sqlalchemy] Re: Just starting with sqlacodegen: wrong command?

2022-06-14 Thread Val Huber
Not sure how this may match your needs, but API Logic Server includes a 
version of sqlacodegen to create an executable Flask project, including a 
web app, API, and rules-based logic.  It includes a Command Line Utility 
that provides SQLAlchemy URI examples:

(venv) val@Vals-MacBook-Pro-16 ApiLogicServer % *ApiLogicServer examples*


Welcome to API Logic Server 5.02.22


Creates and optionally runs a customizable ApiLogicServer project


Examples:

  ApiLogicServer create-and-run

  ApiLogicServer create-and-run --db_url=sqlite:///nw.sqlite

  ApiLogicServer create-and-run 
--db_url=mysql+pymysql://root:p@mysql-container:3306/classicmodels 
--project_name=/localhost/docker_db_project

  ApiLogicServer create-and-run 
--db_url=mssql+pyodbc://sa:posey386!@localhost:1433/NORTHWND?driver=ODBC+Driver+17+for+SQL+Server_connection=no

  ApiLogicServer create-and-run 
--db_url=postgresql://postgres:p@10.0.0.234/postgres

  ApiLogicServer create --project_name=my_schema 
--db_url=postgresql://postgres:p@localhost/my_schema

  ApiLogicServer create 
--db_url=postgresql+psycopg2://postgres:password@localhost:5432/postgres?options=-csearch_path%3Dmy_db_schema

  ApiLogicServer create --project_name=Chinook \

--host=ApiLogicServer.pythonanywhere.com --port= \


--db_url=mysql+pymysql://ApiLogicServer:***@ApiLogicServer.mysql.pythonanywhere-services.com/ApiLogicServer\$Chinook


Where --db_url defaults to supplied sample, or, specify URI for your own 
database:

   SQLAlchemy Database URI help: 
https://docs.sqlalchemy.org/en/14/core/engines.html

   Other URI examples:   
https://github.com/valhuber/ApiLogicServer/wiki/Testing

   Install Guide:
https://github.com/valhuber/ApiLogicServer/wiki/Quick-Start#install-guide

 

Docs: https://github.com/valhuber/ApiLogicServer#readme



(venv) val@Vals-MacBook-Pro-16 ApiLogicServer % 

On Tuesday, June 14, 2022 at 9:06:46 AM UTC-7 tiren...@gmail.com wrote:

> Hi, 
>
> I have tried to run something like this: 
>
> sqlacodegen --generator tables 
> mysql+pymysql://user:password@localhost/dbname
>
> but I get:
>
> usage: sqlacodegen [-h] [--version] [--schema SCHEMA] [--tables TABLES] 
> [--noviews] [--noindexes] [--noconstraints] [--nojoined] [--noinflect] 
> [--noclasses] [--nocomments] [--outfile OUTFILE] [url]
> sqlacodegen: error: unrecognized arguments: --generator 
> mysql+pymysql://root:***@localhost/test_user
>
> My sqlacodegen version is 2.3.0.
>
> Any 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/7e10564c-b467-4869-9095-fd7134a37c4cn%40googlegroups.com.


[sqlalchemy] Re: Many-to-many cascade delete

2021-11-02 Thread Val Huber
Interesting problem... it's not exactly a cascade delete, which goes from 
parent (1 side) to children (many side).

I think you have to provide code to do this - brute force check the parent 
to see if it's an "empty nester".  This can be expensive if you are 
cascading a person delete to many person-secrets.  You might consider 
maintaining a count in secret to prune the query.

LogicBank  (part of ApiLogicServer 
 - both are 
open source) can maintain such counts without code, happy to discuss with 
you if you want to reach out.

Regards,
Val

On Tuesday, November 2, 2021 at 1:49:17 PM UTC-7 Anders Buch wrote:

> Hello All,
>
> Suppose I have a table of people, a table of secrets, and a many-to-many 
> association table between them. A person can exist without knowing any 
> secrets, but a secret without any associated people might as well be 
> deleted. My reading of the documentation is that it is not possible to set 
> cascade options to obtain this behavior? (Because a cascade delete option 
> would cause a secret to be deleted if any person forgets about it?) If 
> correct, is there another elegant way to achieve this?
>
> Thanks in advance!
> Anders Buch
>
>

-- 
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/fde3d025-fda7-420b-b476-7dd295837f79n%40googlegroups.com.


[sqlalchemy] Announcement: API Logic Server Docker Support

2021-09-26 Thread Val Huber
You may be interested in ApiLogicServer 
, open source on Git (79k 
downloads to date).

With 1 command, it creates a customizable project providing a JSON:API, and a 
Basic Web App.  These are based on SQLAlchemy, so it uses sqlacodegen to create 
your model classes.

SQLAlchemy updates (whether by API, Web App or Python) are monitored by 
spreadsheet-like rules 
 - 40X 
more concise than code, extensible with Python.

Release 3.01.10 includes Docker support:
It avoids the often fiddly Python install 

It enables vscode (without Python install), providing code completion to build 
rules, rule debugging, etc

You can also get prepared several DB images (MySQL, Postgresql, and SQLServer ) 
- super for testing

Regards,
Val

-- 
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/D4FB9A2F-388F-4B00-B2A1-2DE5591E37C1%40gmail.com.


[sqlalchemy] Announcing API Logic Server

2021-07-19 Thread Val Huber

You may be interested in ApiLogicServer 
, open source on Git.  
With 1 command, it creates a customizable project providing a JSON:API, and 
a Basic Web App.  These are based on SQLAlchemy, so it uses sqlacodegen to 
create your model classes.

SQLAlchemy updates (whether by API, Web App or Python) are monitored by 
spreadsheet-like rules - 40X more concise than code, extensible with Python.

Regards,
Val

-- 
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/00a0c641-2352-4f31-8210-b373b3d41082n%40googlegroups.com.


[sqlalchemy] Extensible Generation

2021-03-10 Thread Val Huber
I work on ApiLogicServer , 
which creates a *models.py* file (then used to create an API and web app).

My objective is to enable users to

   1. *Customize* *models.py* (e.g, add hybrid attributes, missing 
   relationships, etc), and 
   2. *Preserve* these customizations when  the *models.py* file is later 
   recreated (e.g., the database schema was changed).

I am seeking advice.  I have looked the the following alternatives, but 
they all present issues:

   1. I'd prefer not rely on a *code merge: *let the user alter the 
*Customer.py 
   *file, then merge customizations when *Customer.py* is recreated. 
Certainly a possibility, but it seems cleaner to keep customization files 
   separate from generated files.  
   
   2. I have looked into subclassing - e.g., generate *Customer_base*, let 
   user extend in *Customer(Customer_base)* so all their customizations are 
   in a separate file.  But, I encountered issues since the relationships are 
   bound to the super classes.  For example, anOrder.Customer returns an 
   instance of *Customer_base* instead of *Customer*
   
   3. I investigated the API *sqlalchemy.ext.hybrid.hybrid_property* to 
   create hybrid attributes.  I am familiar with hybrids via annotations, but 
   again, I want this to be in a separate file from customer.py.  I am unable 
   to find what to do with the hybrid_property descriptor (assign it to the 
   class?), which raises doubts about this approach.

A clear approach is not emerging, would appreciate some guidance.

Thanks in advance,
Val


-- 
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/51c6a61a-fbcf-4d0c-b3e4-020f32cd11c7n%40googlegroups.com.


[sqlalchemy] Logic Bank 0.6.0 - Rules for Muti-table derivations, constraints, extensible with Python

2020-12-27 Thread Val Huber
Logic Bank 0.6 
 released 
with support for Extensible Rules, Auditing, Referential Integrity.

Over 3500 downloads.

-- 
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/ac0619b1-5c75-4ef7-ab58-2bbb5bf2838an%40googlegroups.com.


[sqlalchemy] Re: Recreating Access in LibreOffice Base

2020-10-22 Thread Val Huber
Hi, Tom

Not knowing precisely what you looking for, but you might want to check out 
fab-quickstart and logic base.  Here is an article 
 that 
will introduce these open source projects.

On Thursday, October 22, 2020 at 4:12:04 AM UTC-7 Tom Potts wrote:

>
> I used to find MS Access to be a very useful tool in the right hands. I've 
> been doing some python script coding in LibreOffice Base and started 
> looking at sqlalchemy it looks as if it wouldnt be too much of a job to add 
> the components necessary to turn LO Base front end into something not far 
> from the Access of old (I have not used MS for 20 years or so). I was 
> wondering if anyone has ventured there or is interested in providing some 
> input?
>

-- 
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/383a8b9b-91a1-4836-95a6-d3ed9c1449f5n%40googlegroups.com.