Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for get_pk_constraint() method #264

Closed
akurdyukov opened this issue Oct 3, 2023 · 0 comments · Fixed by #265
Closed

Support for get_pk_constraint() method #264

akurdyukov opened this issue Oct 3, 2023 · 0 comments · Fixed by #265

Comments

@akurdyukov
Copy link
Contributor

Describe the bug
Currently driver does not support get_pk_constraint() method. This prevents me from working meltano tap.

To Reproduce
The test I wrote looks like

    @require_server_version(18, 16, 0)
    def test_primary_keys(self):
        self.table_with_primary.create(self.session.bind)
        con = self.dialect.get_pk_constraint(self.session,
                                             self.table_with_primary.name)
        self.assertIsNotNone(con,
                             "Table should contain primary key constrain")
        self.assertTrue("constrained_columns" in con)
        self.assertEqual(("x",), con["constrained_columns"])

where table_with_primary is

        self.table_with_primary = Table(
            'test_primary_table',
            self.metadata(),
            Column('x', types.Int32, primary_key=True),
            engines.MergeTree(
                primary_key=['x']
            )
        )

Expected behavior
Test should pass.

Versions

  • Current main branch
  • Any Python version
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 a pull request may close this issue.

1 participant