repos: 274264484
This data as json
id | node_id | name | full_name | private | owner | html_url | description | fork | created_at | updated_at | pushed_at | homepage | size | stargazers_count | watchers_count | language | has_issues | has_projects | has_downloads | has_wiki | has_pages | forks_count | archived | disabled | open_issues_count | license | topics | forks | open_issues | watchers | default_branch | permissions | temp_clone_token | organization | network_count | subscribers_count | readme | readme_html | allow_forking | visibility | is_template | template_repository | web_commit_signoff_required | has_discussions |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
274264484 | MDEwOlJlcG9zaXRvcnkyNzQyNjQ0ODQ= | sqlite-generate | simonw/sqlite-generate | 0 | 9599 | https://github.com/simonw/sqlite-generate | Tool for generating demo SQLite databases | 0 | 2020-06-22T23:36:44Z | 2021-02-27T15:25:26Z | 2021-02-27T15:25:24Z | https://sqlite-generate-demo.datasette.io/ | 56 | 17 | 17 | Python | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | apache-2.0 | ["sqlite", "datasette-io", "datasette-tool"] | 0 | 0 | 17 | main | {"admin": false, "push": false, "pull": false} | 0 | 2 | # sqlite-generate [](https://pypi.org/project/sqlite-generate/) [](https://github.com/simonw/sqlite-generate/releases) [](https://github.com/simonw/sqlite-generate/blob/master/LICENSE) Tool for generating demo SQLite databases ## Installation Install this plugin using `pip`: $ pip install sqlite-generate ## Demo You can see a demo of the database generated using this command running in [Datasette](https://github.com/simonw/datasette) at https://sqlite-generate-demo.datasette.io/ The demo is generated using the following command: sqlite-generate demo.db --seed seed --fts --columns=10 --fks=0,3 --pks=0,2 ## Usage To generate a SQLite database file called `data.db` with 10 randomly named tables in it, run the following: sqlite-generate data.db You can use the `--tables` option to generate a different number of tables: sqlite-generate data.db --tables 20 You can run the command against the same database file multiple times to keep adding new tables, using different settings for each batch of generated tables. By default each table will contain a random number of rows between 0 and 200. You can customize this with the `--rows` option: sqlite-generate data.db --rows 20 This will insert 20 rows into each table. sqlite-generate data.db --rows 500,2000 This inserts a random number of rows between 500 and 2000 into each table. Each table will have 5 columns. You can change this using `--columns`: sqlite-generate data.db --columns 10 `--columns` can also accept a range: sqlite-generate data.db --columns 5,15 You can control the random number seed used with the `--seed` option. This will result in the exact same database file being created by multiple runs of the tool: sqlite-generate data.db --seed=myseed By default each table will contain between 0 and 2 foreign key columns to other tables. You can control this using the `--fks` option, with either a single number or a range: sqlite-generate data.db --columns=20 --fks=5,15 Each table will have a single primary key column called `id`. You can use the `--pks=` option to change the number of primary key columns on each table. Drop it to 0 to generate [rowid tables](https://www.sqlite.org/rowidtable.html). Increase it above 1 to generate tables with compound primary keys. Or use a range to get a random selection of different primary key layouts: sqlite-generate data.db --pks=0,2 To configure [SQLite full-text search](https://www.sqlite.org/fts5.html) for all columns of type text, use `--fts`: sqlite-generate data.db --fts This will use FTS5 by default. To use [FTS4](https://www.sqlite.org/fts3.html) instead, use `--fts4`. ## Development To contribute to this tool, first checkout the code. Then create a new virtual environment: cd sqlite-generate python -mvenv venv source venv/bin/activate Or if you are using `pipenv`: pipenv shell Now install the dependencies and tests: pip install -e '.[test]' To run the tests: pytest | <div id="readme" class="md" data-path="README.md"><article class="markdown-body entry-content container-lg" itemprop="text"><h1><a id="user-content-sqlite-generate" class="anchor" aria-hidden="true" href="#user-content-sqlite-generate"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>sqlite-generate</h1> <p><a href="https://pypi.org/project/sqlite-generate/" rel="nofollow"><img src="https://camo.githubusercontent.com/f0bc12d9a036f8faadbe40bbc37caa416eadf33d6694322ca385c16f2302b575/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f73716c6974652d67656e65726174652e737667" alt="PyPI" data-canonical-src="https://img.shields.io/pypi/v/sqlite-generate.svg" style="max-width:100%;"></a> <a href="https://github.com/simonw/sqlite-generate/releases"><img src="https://camo.githubusercontent.com/8acbae82ad62477a2630aee86e3c2c6c498a06acc6fd6d6c08e51779ea3905de/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f73696d6f6e772f73716c6974652d67656e65726174653f6c6162656c3d6368616e67656c6f67" alt="Changelog" data-canonical-src="https://img.shields.io/github/v/release/simonw/sqlite-generate?label=changelog" style="max-width:100%;"></a> <a href="https://github.com/simonw/sqlite-generate/blob/master/LICENSE"><img src="https://camo.githubusercontent.com/1698104e976c681143eb0841f9675c6f802bb7aa832afc0c7a4e719b1f3cf955/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d417061636865253230322e302d626c75652e737667" alt="License" data-canonical-src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" style="max-width:100%;"></a></p> <p>Tool for generating demo SQLite databases</p> <h2><a id="user-content-installation" class="anchor" aria-hidden="true" href="#user-content-installation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Installation</h2> <p>Install this plugin using <code>pip</code>:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="$ pip install sqlite-generate "><pre><code>$ pip install sqlite-generate </code></pre></div> <h2><a id="user-content-demo" class="anchor" aria-hidden="true" href="#user-content-demo"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Demo</h2> <p>You can see a demo of the database generated using this command running in <a href="https://github.com/simonw/datasette">Datasette</a> at <a href="https://sqlite-generate-demo.datasette.io/" rel="nofollow">https://sqlite-generate-demo.datasette.io/</a></p> <p>The demo is generated using the following command:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="sqlite-generate demo.db --seed seed --fts --columns=10 --fks=0,3 --pks=0,2 "><pre><code>sqlite-generate demo.db --seed seed --fts --columns=10 --fks=0,3 --pks=0,2 </code></pre></div> <h2><a id="user-content-usage" class="anchor" aria-hidden="true" href="#user-content-usage"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Usage</h2> <p>To generate a SQLite database file called <code>data.db</code> with 10 randomly named tables in it, run the following:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="sqlite-generate data.db "><pre><code>sqlite-generate data.db </code></pre></div> <p>You can use the <code>--tables</code> option to generate a different number of tables:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="sqlite-generate data.db --tables 20 "><pre><code>sqlite-generate data.db --tables 20 </code></pre></div> <p>You can run the command against the same database file multiple times to keep adding new tables, using different settings for each batch of generated tables.</p> <p>By default each table will contain a random number of rows between 0 and 200. You can customize this with the <code>--rows</code> option:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="sqlite-generate data.db --rows 20 "><pre><code>sqlite-generate data.db --rows 20 </code></pre></div> <p>This will insert 20 rows into each table.</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="sqlite-generate data.db --rows 500,2000 "><pre><code>sqlite-generate data.db --rows 500,2000 </code></pre></div> <p>This inserts a random number of rows between 500 and 2000 into each table.</p> <p>Each table will have 5 columns. You can change this using <code>--columns</code>:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="sqlite-generate data.db --columns 10 "><pre><code>sqlite-generate data.db --columns 10 </code></pre></div> <p><code>--columns</code> can also accept a range:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="sqlite-generate data.db --columns 5,15 "><pre><code>sqlite-generate data.db --columns 5,15 </code></pre></div> <p>You can control the random number seed used with the <code>--seed</code> option. This will result in the exact same database file being created by multiple runs of the tool:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="sqlite-generate data.db --seed=myseed "><pre><code>sqlite-generate data.db --seed=myseed </code></pre></div> <p>By default each table will contain between 0 and 2 foreign key columns to other tables. You can control this using the <code>--fks</code> option, with either a single number or a range:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="sqlite-generate data.db --columns=20 --fks=5,15 "><pre><code>sqlite-generate data.db --columns=20 --fks=5,15 </code></pre></div> <p>Each table will have a single primary key column called <code>id</code>. You can use the <code>--pks=</code> option to change the number of primary key columns on each table. Drop it to 0 to generate <a href="https://www.sqlite.org/rowidtable.html" rel="nofollow">rowid tables</a>. Increase it above 1 to generate tables with compound primary keys. Or use a range to get a random selection of different primary key layouts:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="sqlite-generate data.db --pks=0,2 "><pre><code>sqlite-generate data.db --pks=0,2 </code></pre></div> <p>To configure <a href="https://www.sqlite.org/fts5.html" rel="nofollow">SQLite full-text search</a> for all columns of type text, use <code>--fts</code>:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="sqlite-generate data.db --fts "><pre><code>sqlite-generate data.db --fts </code></pre></div> <p>This will use FTS5 by default. To use <a href="https://www.sqlite.org/fts3.html" rel="nofollow">FTS4</a> instead, use <code>--fts4</code>.</p> <h2><a id="user-content-development" class="anchor" aria-hidden="true" href="#user-content-development"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Development</h2> <p>To contribute to this tool, first checkout the code. Then create a new virtual environment:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="cd sqlite-generate python -mvenv venv source venv/bin/activate "><pre><code>cd sqlite-generate python -mvenv venv source venv/bin/activate </code></pre></div> <p>Or if you are using <code>pipenv</code>:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="pipenv shell "><pre><code>pipenv shell </code></pre></div> <p>Now install the dependencies and tests:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="pip install -e '.[test]' "><pre><code>pip install -e '.[test]' </code></pre></div> <p>To run the tests:</p> <div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="pytest "><pre><code>pytest </code></pre></div> </article></div> |
Links from other tables
- 9 rows from repo in releases