Skip to content

generate file directives for standalone mode#28

Merged
datdao merged 1 commit intomasterfrom
d/atlas-lint
May 29, 2025
Merged

generate file directives for standalone mode#28
datdao merged 1 commit intomasterfrom
d/atlas-lint

Conversation

@datdao
Copy link
Copy Markdown
Member

@datdao datdao commented May 27, 2025

This pull request adds support for parsing file directives in standalone mode. Currently, only table line_number directives are supported.

-- atlas:pos user_account[type=table] tests/models/models.py:10
-- atlas:pos address[type=table] tests/models/models.py:23

CREATE TABLE user_account (id SERIAL NOT NULL, name VARCHAR(30) NOT NULL, fullname VARCHAR(30), PRIMARY KEY (id));

CREATE TABLE address (id SERIAL NOT NULL, email_address VARCHAR(30) NOT NULL, user_id INTEGER NOT NULL, PRIMARY KEY (id), FOREIGN KEY(user_id) REFERENCES user_account (id));

The parser now supports the following SQLAlchemy declarative styles:

  • Class-based declaration:
class User(Base):
    __tablename__ = "user_account"
  • Object-based declaration:
users = Table(
    "user_account",
)

@datdao datdao requested review from a8m, giautm and ronenlu May 27, 2025 08:15
@datdao datdao force-pushed the d/atlas-lint branch 3 times, most recently from 6db0b82 to 13d66ce Compare May 27, 2025 08:40
@@ -0,0 +1,117 @@
# Atlas Provider for SQLAlchemy - Development Guide

This document provides instructions for developers who want to contribute to or modify the `atlas-provider-sqlalchemy` project.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@datdao datdao merged commit 8254626 into master May 29, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants