How to use the jardin.query function in jardin

To help you get started, we’ve selected a few jardin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github instacart / jardin / tests / test_query.py View on Github external
def test_query_filename_relative(self):
        User.insert(values={'name': 'jardin'})
        df = jardin.query(
            filename='tests/support/select_users.sql',
            db='jardin_test'
            )
        self.assertEqual(len(df), 1)
        self.assertEqual(df.name.iloc[0], 'jardin')
github instacart / jardin / tests / test_query.py View on Github external
def test_query_filename_absolute(self):
        User.insert(values={'name': 'jardin'})
        filename = os.path.join(os.environ['PWD'], 'tests/support/select_users.sql')
        df = jardin.query(
            filename=filename,
            db='jardin_test'
            )
        self.assertEqual(len(df), 1)
        self.assertEqual(df.name.iloc[0], 'jardin')
github instacart / jardin / tests / test_query.py View on Github external
def test_query_sql(self):
        User.insert(values={'name': 'jardin'})
        df = jardin.query(
            sql='SELECT * FROM users;',
            db='jardin_test'
            )
        self.assertEqual(len(df), 1)
        self.assertEqual(df.name.iloc[0], 'jardin')
github instacart / jardin / tests / test_query.py View on Github external
def test_query_params(self):
        if User.db().db_config.scheme == 'sqlite':
            return
        User.insert(values={'name': 'jardin'})
        df = jardin.query(
            sql='SELECT * FROM users WHERE name IN %(names)s;',
            params={'names': ['jardin']},
            db='jardin_test'
            )
        self.assertEqual(len(df), 1)