Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 142
    • Merge requests 142
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !367

Closed
Created Sep 01, 2017 by Vincent Pelletier@vpelletierOwner
  • Report abuse
Report abuse

Getting rid of {as,build}SQL*Expression

  • Overview 14
  • Commits 6
  • Changes 24

This is the next step on the road of re-concentrating SQL generation inside ZSQLCatalog + ZSQLMethods.

As with previous patch set ( !307 (merged) on DomainTool), there was some preparatory work which I believe does not require review (small-ish functional extensions, API abuses tolerated by old code but detected by new code) and which I already pushed to master.

Preparatory work in this merge request, so the maybe-non-consensual stuff:

  • one commit by @kazuhiko which fixes a testSecurity.TestSecurity failure. It does not belong to this Merge Request, but helped getting cleaner test results. It should be pushed by @kazuhiko to master independently from the merge request. EDIT: now merged, and rebased over latest master, fixing conflicts.
  • extend parent relation condition generation in getCategoryValueDictParameterDict as I realise working on this that legacy SQL generation methods support more than single-level matches. I would prefer to not have to include this commit, as it makes parent relation more expensive than other relations when non-strict, and a bit more expensive when reversed (aka "related"). Also, I believe extending the usual non-strict relation mechanism to the special parent one is not easy to mentally map (because there is one less indirection level), so I would expect it to rarely be actualy needed or used consciously. Anyway, if it goes in, this implementation will be more efficient than existing one by implementing non-strict forward relation as a LIKE match on path instead of recursing through subcontainers. please comment if you knew about this support. EDIT: While this change is still visible in this merge request, I now consider it as good for master. EDIT: now pushed to master
  • two deletion commits please comment if you really want to save these: EDIT: Pushed to reduce the amount of diff in this merge request.
    • getting rid of Resource_zGetInventory, which is dead code for years in public master. If any project depend on it, they can trivially copy it, but it is not maintained in master - this is just making it clear.
    • getting rid of never used erp5_mysql_ndb_catalog BT. I'm a bit annoyed that this gets rid of the only "other" catalog BT, but it never actually worked, as MySQL NDB quickly proved too buggy back when I created it (2006~2007), and it has not been tested (automatically or otherwise) since, so there is no way it works now. And the code value is close to zero too: it is basically a copy from innodb catalog with a few columns types changes to fit NDB type constraints from that time.

And the main beef of this change please review:

  • two new methods producing catalog Queries where legacy code produces SQL.
  • three commits moving to the API added above
  • one commit to drop legacy SQL-generating methods: just like for DomainTool in previous merge request, such methods will eventually break (hopefully soon) even if we keep them right now.

/cc @seb @jerome @jp @jm @kazuhiko

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: asSQLExpression
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7