Giter VIP home page Giter VIP logo

Comments (5)

chipx86 avatar chipx86 commented on June 11, 2024

There's no direct support in Django Evolution for SQL Anywhere. How are you using this today?

I'm happy to take a patch that adds such support, so long as it doesn't impact any other backends. (Just FYI, we don't use pull requests. Patches must be posted to https://reviews.reviewboard.org/.

from django-evolution.

gperrow-SAP avatar gperrow-SAP commented on June 11, 2024

I work for SAP in SQL Anywhere engineering, and I'm in the process of writing a driver for SQL Anywhere. The problem is that the 'op' field is used both to distinguish between different ALTER operations and as the actual SQL syntax. There needs to be a way to say "I'm doing an ADD COLUMN operation, but the SQL clause to use is 'ADD'".

from django-evolution.

chipx86 avatar chipx86 commented on June 11, 2024

Ah, I see.

So my first stab at what I think we should do (and, not working through this problem myself, I might be wrong), is to remove the hard-coded names in sql_result.py, and instead refer to constants on the backend's class for those names. The defaults would be 'MODIFY COLUMN' and 'ADD COLUMN', but your backend could change those to 'ALTER' and 'ADD'. The list could then be updated to refer to those.

That way, the op remains what it is today, the actual ALTER TABLE operation being performed. The backend is in complete control of the name.

If even more specialized logic/formatting is needed, I'd then suggest to break out that bit of logic further into a function that the backend can override in order to better prepare its ALTER TABLE statement.

Does that sound like it'd work? Or is there a gotcha somewhere?

from django-evolution.

gperrow-SAP avatar gperrow-SAP commented on June 11, 2024

That sounds right.

from django-evolution.

chipx86 avatar chipx86 commented on June 11, 2024

Long overdue, but with the new major rewrite, it's now possible for backends to implement their own version of the AlterTableSQLResult. SQLite has its own, which it processes and turns into suitable SQL.

from django-evolution.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.