-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Ghaith Kdimati <[email protected]>"
- Loading branch information
Showing
9 changed files
with
77 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,8 @@ upload_to_vcs_release = true | |
|
||
|
||
|
||
|
||
|
||
[project] | ||
name = "rls" | ||
version = "0.3.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""initial updates | ||
Revision ID: 479bd311af91 | ||
Revises: | ||
Create Date: 2024-09-30 15:47:22.747484 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "479bd311af91" | ||
down_revision: Union[str, None] = None | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_policy( | ||
table_name="items", | ||
policy_name="items_permissive_all_policy_0", | ||
cmd="ALL", | ||
definition="PERMISSIVE", | ||
expr="owner_id > NULLIF(current_setting('rls.account_id', true),'')::INTEGER", | ||
) # type: ignore | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_policy(tablename="items", policyname="items_permissive_all_policy_0") # type: ignore | ||
# ### end Alembic commands ### |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
# sync_setup.py | ||
from .engines import setup_engine as engine | ||
from .models import RlsBase | ||
# # sync_setup.py | ||
# from .engines import setup_engine as engine | ||
# from .models import RlsBase | ||
|
||
print("Setting up database") | ||
# print("Setting up database") | ||
|
||
|
||
def setup_database(): | ||
print("Setting up database") | ||
# Create tables | ||
RlsBase.metadata.create_all(engine) | ||
# def setup_database(): | ||
# print("Setting up database") | ||
# # Create tables | ||
# RlsBase.metadata.create_all(engine) | ||
|
||
|
||
def teardown_database(): | ||
print("Tearing down database") | ||
# Drop tables | ||
RlsBase.metadata.drop_all(engine) | ||
# def teardown_database(): | ||
# print("Tearing down database") | ||
# # Drop tables | ||
# RlsBase.metadata.drop_all(engine) | ||
|
||
|
||
if __name__ == "__main__": | ||
setup_database() | ||
# if __name__ == "__main__": | ||
# setup_database() |
Oops, something went wrong.