ALTER TABLE support?

Offen
#35 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
php, sql
Bereich
databases

Rechercherichtung

Start at the parser entry point used by parse() and trace how CREATE TABLE statements are represented in tables. Study the ALTER TABLE example and define how multiple operations remain in source order. Done means supported ALTER TABLE statements produce an alters property while tables and parse() retain their existing behavior.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Hi, and thanks for your work on this library!

What do you think about adding support for ALTER TABLE statements?

As an example, the output could be a separate alters property next to tables, in source order:

$parser->parse("ALTER TABLE t ADD COLUMN b INT NOT NULL AFTER a, DROP COLUMN c");

$parser->alters = [
    [
        'name'     => 't',
        'database' => null,
        'ops'      => [
            ['op' => 'ADD_COLUMN',  'field' => ['name' => 'b', 'type' => 'INT', 'null' => false], 'after' => 'a'],
            ['op' => 'DROP_COLUMN', 'name' => 'c'],
        ],
    ],
];

tables and the return value of parse() would stay as they are.

Vorherrschende Sprache
PHP
Sterne
78
Forks
22
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus iamcal/SQLParser

Alle Issues in iamcal/SQLParser

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.