Skip to content

Syntactic sugar for ATTACH DATABASE #113

Description

@simonw

https://www.sqlite.org/lang_attach.html

Maybe something like this:

db.attach("other_db", "other_db.db")

Activity

  1. simonw commented on May 19, 2020

    @simonw
    OwnerAuthor

    Here's how twitter-to-sqlite does it: https://github.com/dogsheep/twitter-to-sqlite/blob/6be0ffcee24504fa2964b0e526842b8cfce7567b/twitter_to_sqlite/utils.py#L506-L511

                    attach_sql = """
                        ATTACH DATABASE '{}' AS [{}];
                    """.format(
                        str(pathlib.Path(filepath).resolve()), alias
                    )
                    db.conn.execute(attach_sql)
  2. added a commit that references this issue on Feb 19, 2021
  3. added a commit that references this issue on Mar 12, 2024
    999f099
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions