How to use the turbodbc.DATETIME function in turbodbc

To help you get started, we’ve selected a few turbodbc 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 blue-yonder / turbodbc / python / turbodbc_test / test_cursor_select.py View on Github external
def fix_case(string):
            if capabilities['reports_column_names_as_upper_case']:
                return string.upper()
            else:
                return string

        with query_fixture(cursor, configuration, 'DESCRIPTION') as table_name:
            cursor.execute("SELECT * FROM {}".format(table_name))

            nullness_for_null_column = not capabilities['indicates_null_columns']

            expected = [(fix_case('as_int'), turbodbc.NUMBER, None, None, None, None, True),
                        (fix_case('as_double'), turbodbc.NUMBER, None, None, None, None, True),
                        (fix_case('as_varchar'), turbodbc.STRING, None, None, None, None, True),
                        (fix_case('as_date'), turbodbc.DATETIME, None, None, None, None, True),
                        (fix_case('as_timestamp'), turbodbc.DATETIME, None, None, None, None, True),
                        (fix_case('as_int_not_null'), turbodbc.NUMBER, None, None, None, None, nullness_for_null_column)]
            assert expected == cursor.description