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

Way to test SQLite 3.37 (and potentially other versions) in CI #346

Open
simonw opened this issue Nov 29, 2021 · 5 comments
Open

Way to test SQLite 3.37 (and potentially other versions) in CI #346

simonw opened this issue Nov 29, 2021 · 5 comments
Labels

Comments

@simonw
Copy link
Owner

simonw commented Nov 29, 2021

Need to figure out a good pattern for testing this in CI too - it will currently skip the new tests if it doesn't have SQLite 3.37 or higher.

Originally posted by @simonw in #344 (comment)

@simonw simonw added the ci label Nov 29, 2021
@simonw
Copy link
Owner Author

simonw commented Nov 29, 2021

Ideally I'd like an extra set of matrix options for different versions of SQLite.

I can use pysqlite3 for this, but it isn't a completely compatible drop-in replacement - turns out it doesn't support the iterdump() method for example, see coleifer/pysqlite3#24

@simonw
Copy link
Owner Author

simonw commented Nov 29, 2021

Here's a modified version of the dump command that works even with pysqlite3:

@cli.command()
@click.argument(
    "path",
    type=click.Path(exists=True, file_okay=True, dir_okay=False, allow_dash=False),
    required=True,
)
@load_extension_option
def dump(path, load_extension):
    """Output a SQL dump of the schema and full contents of the database"""
    db = sqlite_utils.Database(path)
    _load_extensions(db, load_extension)
    # pysqlite3 doesn't implement .iterdump()
    from sqlite3.dump import _iterdump

    for line in _iterdump(db.conn):
        click.echo(line)

@simonw
Copy link
Owner Author

simonw commented Nov 29, 2021

For the moment I think I'll combine two problems into one, and just add a single matrix alternative that uses pysqlite3 running SQLite 3.37.0 - only on macOS and Linux so I don't have to figure out how to compile it for Windows.

@simonw
Copy link
Owner Author

simonw commented Nov 29, 2021

I have a working recipe for compiling it for macOS here: #344 (comment)

@simonw
Copy link
Owner Author

simonw commented Nov 29, 2021

To keep things simple for the moment I'm only going to add one extra thing to the matrix, and it will be a run of the tests against SQLite 3.37.0 using pysqlite3 on Linux only.

I can use this mechanism: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#example-including-new-combinations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant