ApiLogicServer 16.0.3__py3-none-any.whl → 16.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- api_logic_server_cli/api_logic_server.py +2 -1
- api_logic_server_cli/api_logic_server_info.yaml +3 -3
- api_logic_server_cli/prototypes/basic_demo/logic/procedural/declarative-vs-procedural-comparison.md +1 -1
- api_logic_server_cli/prototypes/manager/samples/readme_samples.md +1 -0
- api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/sqlacodegen/codegen.py +21 -4
- api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen_wrapper.py +2 -1
- {apilogicserver-16.0.3.dist-info → apilogicserver-16.0.4.dist-info}/METADATA +1 -1
- {apilogicserver-16.0.3.dist-info → apilogicserver-16.0.4.dist-info}/RECORD +12 -12
- {apilogicserver-16.0.3.dist-info → apilogicserver-16.0.4.dist-info}/WHEEL +0 -0
- {apilogicserver-16.0.3.dist-info → apilogicserver-16.0.4.dist-info}/entry_points.txt +0 -0
- {apilogicserver-16.0.3.dist-info → apilogicserver-16.0.4.dist-info}/licenses/LICENSE +0 -0
- {apilogicserver-16.0.3.dist-info → apilogicserver-16.0.4.dist-info}/top_level.txt +0 -0
|
@@ -12,9 +12,10 @@ ApiLogicServer CLI: given a database url, create [and run] customizable ApiLogic
|
|
|
12
12
|
Called from api_logic_server_cli.py, by instantiating the ProjectRun object.
|
|
13
13
|
'''
|
|
14
14
|
|
|
15
|
-
__version__ = "16.00.
|
|
15
|
+
__version__ = "16.00.04" # last public release: 16.00.03
|
|
16
16
|
recent_changes = \
|
|
17
17
|
f'\n\nRecent Changes:\n' +\
|
|
18
|
+
"\t12/11/2025 - 16.00.04: bug fix [106] - SqlServer autoinsert \n"\
|
|
18
19
|
"\t11/25/2025 - 16.00.03: Probabalistic logic (w/ fallback, cand*) - see basic_demo/readme_ai_mcp.md \n"\
|
|
19
20
|
"\t11/12/2025 - 15.04.03: Copilot rules on updates, tighter basic_demo startup, allow for demo_ai_mcp/then tutorial \n"\
|
|
20
21
|
"\t11/08/2025 - 15.04.00: Nat lang Copilot data access, fix Manager/Copilot startup, finding venv in project \n"\
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
last_created_date:
|
|
2
|
-
last_created_project_name: ../../../servers/
|
|
3
|
-
last_created_version:
|
|
1
|
+
last_created_date: December 10, 2025 19:14:55
|
|
2
|
+
last_created_project_name: ../../../servers/postgres-nw
|
|
3
|
+
last_created_version: 16.00.04
|
api_logic_server_cli/prototypes/basic_demo/logic/procedural/declarative-vs-procedural-comparison.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
We asked **GitHub Copilot** to generate business logic code from natural language requirements.
|
|
11
11
|
|
|
12
|
-
It generated **220 lines of procedural code
|
|
12
|
+
It generated **220 lines of procedural code** (to see it, [click here](https://github.com/ApiLogicServer/ApiLogicServer-src/blob/main/api_logic_server_cli/prototypes/basic_demo/logic/procedural/credit_service.py)).
|
|
13
13
|
|
|
14
14
|
We asked: **"What if the order's customer_id changes?"**
|
|
15
15
|
Copilot found a critical bug and fixed it.
|
|
@@ -34,6 +34,7 @@ genai-logic create --db_url=sqlite:///samples/dbs/todos.sqlite --project_name=to
|
|
|
34
34
|
genai-logic create --db_url=sqlite:////Users/val/dev/ApiLogicServer/ApiLogicServer-dev/clean/ApiLogicServer/samples/dbs/todos.sqlite --project_name=todo
|
|
35
35
|
|
|
36
36
|
# from localhost to mysql container
|
|
37
|
+
genai-logic create --db_url=mysql+pymysql://root:p@localhost:3306/Northwind --project_name=mysql-northwind
|
|
37
38
|
genai-logic create --db_url=mysql+pymysql://root:p@localhost:3306/classicmodels --project_name=docker_classicmodels
|
|
38
39
|
genai-logic create --db_url=mysql+pymysql://root:p@localhost:3306/Chinook --project_name=docker_chinook
|
|
39
40
|
|
|
@@ -1204,6 +1204,7 @@ else:
|
|
|
1204
1204
|
column.index = True
|
|
1205
1205
|
kwarg.append('index')
|
|
1206
1206
|
|
|
1207
|
+
autoincrement = False
|
|
1207
1208
|
if Computed and isinstance(column.server_default, Computed):
|
|
1208
1209
|
expression = self._get_compiled_expression(column.server_default.sqltext)
|
|
1209
1210
|
|
|
@@ -1214,17 +1215,24 @@ else:
|
|
|
1214
1215
|
server_default = 'Computed({!r}{})'.format(expression, persist_arg)
|
|
1215
1216
|
|
|
1216
1217
|
elif column.server_default:
|
|
1218
|
+
# tests:
|
|
1219
|
+
# SQL Server Types [TVF]. server_default is Identity(start=1, increment=1) sqlalchemy.sql.schema.Identity
|
|
1220
|
+
# 6 - Create Postgres (servers) server_default is DefaultClause: sqlalchemy.sql.schema.DefaultClause
|
|
1221
|
+
# dev must pip install psycopg==3.2.13, pip install psycopg-binary==3.2.13
|
|
1217
1222
|
# The quote escaping does not cover pathological cases but should mostly work FIXME SqlSvr no .arg
|
|
1218
1223
|
# not used for postgres/mysql; for sqlite, text is '0'
|
|
1219
|
-
if
|
|
1220
|
-
|
|
1221
|
-
else:
|
|
1224
|
+
if hasattr( column.server_default, 'arg' ):
|
|
1225
|
+
pass # employee_id = Column(Integer, server_default=text("nextval('employees_employee_id_seq'::regclass)"), primary_key=True)
|
|
1222
1226
|
default_expr = self._get_compiled_expression(column.server_default.arg)
|
|
1223
1227
|
if '\n' in default_expr:
|
|
1224
1228
|
server_default = 'server_default=text("""\\\n{0}""")'.format(default_expr)
|
|
1225
1229
|
else:
|
|
1226
1230
|
default_expr = default_expr.replace('"', '\\"')
|
|
1227
1231
|
server_default = 'server_default=text("{0}")'.format(default_expr)
|
|
1232
|
+
elif isinstance(column.server_default, sqlalchemy.sql.schema.Identity): # sqlsvr is different
|
|
1233
|
+
autoincrement = True # EmployeeId = Column(Integer, primary_key=True, autoincrement=True)
|
|
1234
|
+
else:
|
|
1235
|
+
server_default = 'server_default=text("{0}")'.format('0')
|
|
1228
1236
|
|
|
1229
1237
|
comment = getattr(column, 'comment', None)
|
|
1230
1238
|
if (column.name + "") == "xx_id":
|
|
@@ -1233,20 +1241,29 @@ else:
|
|
|
1233
1241
|
log.debug(f"render_column show name is true: {column.table.name}.{column.name}") # researching why
|
|
1234
1242
|
if column.name == "credit_limit" and column.table.name == "customers":
|
|
1235
1243
|
debug_stop = "render column breakpoint"
|
|
1244
|
+
if column.name == "photo" and column.table.name == "employees":
|
|
1245
|
+
debug_stop = "render column breakpoint"
|
|
1236
1246
|
rendered_col_type = self.render_column_type(column.type) if render_coltype else ""
|
|
1237
1247
|
rendered_name = repr(column.name) if do_show_name else ""
|
|
1248
|
+
"""
|
|
1249
|
+
The {0} gets replaced by whatever is passed to .format().
|
|
1250
|
+
In this case, it's the result of ', '.join(...)
|
|
1251
|
+
which joins together all the column attributes (name, type, constraints, defaults, etc.) with commas.
|
|
1252
|
+
eg. Column(Integer, primary_key=True), Column(String(8000))
|
|
1253
|
+
"""
|
|
1238
1254
|
render_result = 'Column({0})'.format(', '.join(
|
|
1239
1255
|
([repr(column.name)] if do_show_name else []) +
|
|
1240
1256
|
([self.render_column_type(column.type)] if render_coltype else []) +
|
|
1241
1257
|
[self.render_constraint(x) for x in dedicated_fks] +
|
|
1242
1258
|
[repr(x) for x in column.constraints] +
|
|
1243
1259
|
([server_default] if server_default else []) +
|
|
1260
|
+
(['autoincrement=True'] if autoincrement else []) +
|
|
1244
1261
|
['{0}={1}'.format(k, repr(getattr(column, k))) for k in kwarg] +
|
|
1245
1262
|
(['comment={!r}'.format(comment)] if comment and not self.nocomments else []) +
|
|
1246
1263
|
(['quote = True'] if self.model_creation_services.project.quote else [])
|
|
1247
1264
|
))
|
|
1248
1265
|
|
|
1249
|
-
"""
|
|
1266
|
+
""" old version without quote = True
|
|
1250
1267
|
return 'Column({0})'.format(', '.join(
|
|
1251
1268
|
([repr(column.name)] if show_name else []) +
|
|
1252
1269
|
([self.render_column_type(column.type)] if render_coltype else []) +
|
|
@@ -132,7 +132,7 @@ def fix_generated(code, args):
|
|
|
132
132
|
code = code.replace(bad_import,"# " + bad_import)
|
|
133
133
|
code = code.replace(line1, line1 + bad_import + "\n")
|
|
134
134
|
# code = code.replace("Column(Image)","Column(Text)") FAILS - incompatible type
|
|
135
|
-
if "postgres" in args.url:
|
|
135
|
+
if fix_postgress_largebinary := False and "postgres" in args.url:
|
|
136
136
|
code = code.replace("Column(LargeBinary)","Column(Text)")
|
|
137
137
|
|
|
138
138
|
# Column(IMAGE)
|
|
@@ -217,6 +217,7 @@ def create_models_memstring(args) -> str:
|
|
|
217
217
|
# For Python 3.13+, force PostgreSQL URLs to use psycopg3 dialect
|
|
218
218
|
engine_url = args.url
|
|
219
219
|
if sys.version_info >= (3, 13) and engine_url.startswith('postgresql://'):
|
|
220
|
+
# dev must pip install psycopg==3.2.13, pip install psycopg-binary==3.2.13
|
|
220
221
|
engine_url = engine_url.replace('postgresql://', 'postgresql+psycopg://', 1)
|
|
221
222
|
|
|
222
223
|
engine = create_engine(engine_url) # type _engine.Engine
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
api_logic_server_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
api_logic_server_cli/api_logic_server.py,sha256=
|
|
3
|
-
api_logic_server_cli/api_logic_server_info.yaml,sha256=
|
|
2
|
+
api_logic_server_cli/api_logic_server.py,sha256=hlvAAyelcfiex9Fvro7xXSLQY-HXoAWz8TRV-W8Mb6g,105245
|
|
3
|
+
api_logic_server_cli/api_logic_server_info.yaml,sha256=99QQaYQFR0kerupFvyUdYGahGyE8Q_DffKa6ESNOUF4,133
|
|
4
4
|
api_logic_server_cli/cli.py,sha256=xAqTOhq-OnXU2HEQgzsGC9yKrGcAgKUt_8b9U2bV5No,87831
|
|
5
5
|
api_logic_server_cli/cli_args_base.py,sha256=7cVM6BeizwttYAwUu1FUyuLuvWufvgt0TFeA8FI6tu0,3304
|
|
6
6
|
api_logic_server_cli/cli_args_project.py,sha256=I5no_fGRV_ZsK3SuttVDAaQYI4Q5zCjx6LojGkM024w,4645
|
|
@@ -698,7 +698,7 @@ api_logic_server_cli/prototypes/basic_demo/iteration/logic/declare_logic.py,sha2
|
|
|
698
698
|
api_logic_server_cli/prototypes/basic_demo/iteration/ui/admin/admin.yaml,sha256=uqxqYNMbKm4aCaTOy5CnlAtYccYM32-oQLVi5K6tfNI,3554
|
|
699
699
|
api_logic_server_cli/prototypes/basic_demo/logic/declarative-vs-procedural-comparison.html,sha256=GUzgmnWdT709M5mPJGyfF1ARzzz3y5guASDBWeG43PU,3915
|
|
700
700
|
api_logic_server_cli/prototypes/basic_demo/logic/procedural/credit_service.py,sha256=n_7YzxxssaxfuB8-nu_jPrQ-H6leAqKjJQRfOKcQwR4,7525
|
|
701
|
-
api_logic_server_cli/prototypes/basic_demo/logic/procedural/declarative-vs-procedural-comparison.md,sha256=
|
|
701
|
+
api_logic_server_cli/prototypes/basic_demo/logic/procedural/declarative-vs-procedural-comparison.md,sha256=rCCDEbtbpnsGUfCFarhblNlcVWc8uZQf27nkYmXka88,16012
|
|
702
702
|
api_logic_server_cli/prototypes/basic_demo/logic/procedural/declarative-vs-procedural-comparison.png,sha256=JYukeefOas_GGBVvRGdHGAtD124H6EILQsEtjFxPrPE,842498
|
|
703
703
|
api_logic_server_cli/prototypes/basic_demo/ui/my-react-app/README.md,sha256=h7ePuwOqn3jv7YkjM4ruaP5rpYBmr_4Q3NChhb8pVJ4,452
|
|
704
704
|
api_logic_server_cli/prototypes/basic_demo/ui/my-react-app/README_create_react_app.md,sha256=cOr7x6X9RmqjITtafhsqQTg8vl1Ob8X0WC78WL21CdE,3359
|
|
@@ -817,7 +817,7 @@ api_logic_server_cli/prototypes/manager/.github/sync-to-dev-src.sh,sha256=hZbc5f
|
|
|
817
817
|
api_logic_server_cli/prototypes/manager/.github/welcome.md,sha256=9Wtufrx0wRf_5jgne8K9T6Sntm2yhyR3bnFKL_ch_0M,1841
|
|
818
818
|
api_logic_server_cli/prototypes/manager/.vscode/launch.json,sha256=B9NaDoTvJsXg1qeEuhG3RdRk4M2RpnpHBW6b8oXrBn4,33551
|
|
819
819
|
api_logic_server_cli/prototypes/manager/.vscode/settings.json,sha256=Ceq5Z34iC6hXNoPLahFHKAn39wjdh2VZqshkWAOXu9g,660
|
|
820
|
-
api_logic_server_cli/prototypes/manager/samples/readme_samples.md,sha256=
|
|
820
|
+
api_logic_server_cli/prototypes/manager/samples/readme_samples.md,sha256=Y8T9C4uaLOOfrTpJjqm1x9St1hqDTqttchjZbns2BnY,3739
|
|
821
821
|
api_logic_server_cli/prototypes/manager/samples/basic_demo_sample/.env,sha256=VCYAc9rxtOuDpv4Og6QwVV8bhzipEGu4sf--kI4Lq5k,355
|
|
822
822
|
api_logic_server_cli/prototypes/manager/samples/basic_demo_sample/.gitignore,sha256=PAO98cVvjgAL_mvXCMS_Vfk7bT2Vd1-j9a8_nB2qxqs,190
|
|
823
823
|
api_logic_server_cli/prototypes/manager/samples/basic_demo_sample/_config.yml,sha256=KIUQQpjgj7hP_Z2Fksq90E52UnbKnyom-v9L_eIfqZo,170
|
|
@@ -2827,7 +2827,7 @@ api_logic_server_cli/sqlacodegen_wrapper/Readme.md,sha256=pcBng3xB7DHqcLSY9NgVlt
|
|
|
2827
2827
|
api_logic_server_cli/sqlacodegen_wrapper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2828
2828
|
api_logic_server_cli/sqlacodegen_wrapper/console_log.txt,sha256=RvaA45ZgMc5won9JzwK9BMK0LKfkiARNS0EW31vjTeM,53944
|
|
2829
2829
|
api_logic_server_cli/sqlacodegen_wrapper/requirements.txt,sha256=13u62njPM4Emzdxow4V8xxYVjBQoO3aSAtNt0Z_V3aE,54
|
|
2830
|
-
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen_wrapper.py,sha256=
|
|
2830
|
+
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen_wrapper.py,sha256=hScDU6cKyp2SLDaH_Ag3KMvJ5hL1kcYkzKZ8bzlNSiM,22582
|
|
2831
2831
|
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/.travis.yml,sha256=mz8WDjTN-Rj9quyH-OZfTRcrACRZ98Dk0V_Z1v8udGY,1850
|
|
2832
2832
|
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/CHANGES.rst,sha256=lpwnI9rMfFx-TbbTa83B0qmracfKFSKnJMDVBR150fk,2593
|
|
2833
2833
|
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/README.rst,sha256=i5RCj2RqmvoDWv4tczRiJ3a5ONugmW69-kjbTzGc7JA,3865
|
|
@@ -2837,7 +2837,7 @@ api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/setup.cfg,sha256=BmOXcaPR0F
|
|
|
2837
2837
|
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/setup.py,sha256=ekn0wq_leWEKgpvijFLI881EVokkaZZhfmZYSQIZquo,196
|
|
2838
2838
|
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/tox.ini,sha256=mVlmM_uI-7K4pLs-jBfu8ZOQpHwQj8fh7LogvwjXJyE,440
|
|
2839
2839
|
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/sqlacodegen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2840
|
-
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/sqlacodegen/codegen.py,sha256=
|
|
2840
|
+
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/sqlacodegen/codegen.py,sha256=gwfwhLfWuZqaWf81ALVnTtDPyzWlbyZuzktXnXeoZs8,79110
|
|
2841
2841
|
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/sqlacodegen/main.py,sha256=BX0gX5e9n5MSzE2tr3O3yRmWuv55mjDI3Z2JSACrUd4,3840
|
|
2842
2842
|
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/sqlacodegen/als_safrs_310/delete_log.txt,sha256=gMkXWPBkd-jEb-P7UA8WkCnV8tAccBL-IhT41Jz5TRw,16390
|
|
2843
2843
|
api_logic_server_cli/sqlacodegen_wrapper/sqlacodegen/sqlacodegen/als_safrs_310/notes.txt,sha256=6KP8dOvdWsIGrpRmaueXbo_ZpD-6Edz-pOfTE80cScA,3991
|
|
@@ -2872,9 +2872,9 @@ api_logic_server_cli/tools/mini_skel/database/system/SAFRSBaseX.py,sha256=p8C7AF
|
|
|
2872
2872
|
api_logic_server_cli/tools/mini_skel/database/system/TestDataBase.py,sha256=U02SYqThsbY5g3DX7XGaiMxjZBuOpzvtPS6RfI1WQFg,371
|
|
2873
2873
|
api_logic_server_cli/tools/mini_skel/logic/declare_logic.py,sha256=fTrlHyqMeZsw_TyEXFa1VlYBL7fzjZab5ONSXO7aApo,175
|
|
2874
2874
|
api_logic_server_cli/tools/mini_skel/logic/load_verify_rules.py,sha256=Rr5bySJpYCZmNPF2h-phcPJ53nAOPcT_ohZpCD93-a0,7530
|
|
2875
|
-
apilogicserver-16.0.
|
|
2876
|
-
apilogicserver-16.0.
|
|
2877
|
-
apilogicserver-16.0.
|
|
2878
|
-
apilogicserver-16.0.
|
|
2879
|
-
apilogicserver-16.0.
|
|
2880
|
-
apilogicserver-16.0.
|
|
2875
|
+
apilogicserver-16.0.4.dist-info/licenses/LICENSE,sha256=67BS7VC-Z8GpaR3wijngQJkHWV04qJrwQArVgn9ldoI,1485
|
|
2876
|
+
apilogicserver-16.0.4.dist-info/METADATA,sha256=l9CLF7s6YwmjIj_UjYcDuZYPYjweLlKKh_ctNYExhR0,26461
|
|
2877
|
+
apilogicserver-16.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
2878
|
+
apilogicserver-16.0.4.dist-info/entry_points.txt,sha256=W9EVNvf09h8n6rJChmVj2gzxVQ6BXXZa2x3wri0lFGc,259
|
|
2879
|
+
apilogicserver-16.0.4.dist-info/top_level.txt,sha256=-r0AT_GEApleihg-jIh0OMvzzc0BO1RuhhOpE91H5qI,21
|
|
2880
|
+
apilogicserver-16.0.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|