You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/quickstart.rst
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,9 @@ After :ref:`Installation <page-installation>`, we can run ``sqlsynthgen`` to see
25
25
remove-vocab Truncate all vocabulary tables in the dst schema.
26
26
validate-config Validate the format of a config file.
27
27
28
-
For the simplest case, we will need `make-tables`, `make-generators`, `create-tables` and `create-data` but, first,
28
+
For the simplest case, we will need ``make-tables``, ``make-generators``, ``create-tables`` and ``create-data`` but, first,
29
29
we need to set environment variables to tell sqlsynthgen how to access our source database (where the real data resides now) and destination database (where the synthetic data will go).
30
-
We can do that in the terminal with the `export` keyword, as shown below, or in a file called `.env`.
30
+
We can do that in the terminal with the ``export`` keyword, as shown below, or in a file called ``.env``.
31
31
The source and destination may be on the same database server, as long as the database or schema names differ.
32
32
If the source and destination schemas are the default schema for the user on that database, you should not set those variables.
33
33
If you are using a DBMS that does not support schemas (e.g. MariaDB), you must not set those variables.
@@ -40,39 +40,39 @@ If you are using a DBMS that does not support schemas (e.g. MariaDB), you must n
Next, we make a SQLAlchemy file that defines the structure of your database using the `make-tables` command:
43
+
Next, we make a SQLAlchemy file that defines the structure of your database using the ``make-tables`` command:
44
44
45
45
.. code-block:: console
46
46
47
47
$ sqlsynthgen make-tables
48
48
49
-
This will have created a file called `orm.py` in the current directory, with a SQLAlchemy class for each of your tables.
49
+
This will have created a file called ``orm.py`` in the current directory, with a SQLAlchemy class for each of your tables.
50
50
51
51
The next step is to make a sqlsynthgen file that defines one data generator per table in the source database:
52
52
53
53
.. code-block:: console
54
54
55
55
$ sqlsynthgen make-generators
56
56
57
-
This will have created a file called `ssg.py` in the current directory.
57
+
This will have created a file called ``ssg.py`` in the current directory.
58
58
59
-
We can use the `create-table` command to read the `orm.py` file, create our destination schema (if it doesn't already exist) and to create empty copies of all the tables that in the source database.
59
+
We can use the ``create-table`` command to read the ``orm.py`` file, create our destination schema (if it doesn't already exist), and to create empty copies of all the tables that are in the source database.
60
60
61
61
.. code-block:: console
62
62
63
63
$ sqlsynthgen create-tables
64
64
65
-
Now that we have created the schema that will hold synthetic data, we can use the `create-data` command to read `orm.py` & `ssg.py` and generate data:
65
+
Now that we have created the schema that will hold synthetic data, we can use the ``create-data`` command to read ``orm.py`` & ``ssg.py`` and generate data:
66
66
67
67
.. code-block:: console
68
68
69
69
$ sqlsynthgen create-data
70
70
71
-
By default, `create-data` will have inserted one row per table and will have used the column data types to decide how to randomly generate data.
72
-
To create more data each time we call `create-data`, we can provide an integer argument:
71
+
By default, ``create-data`` will have inserted one row per table and will have used the column data types to decide how to randomly generate data.
72
+
To create more data each time we call ``create-data``, we can provide the ``num-passes`` argument:
73
73
74
74
.. code-block:: console
75
75
76
-
$ sqlsynthgen create-data 10
76
+
$ sqlsynthgen create-data --num-passes=10
77
77
78
78
We will have inserted 11 rows per table, with the last two commands.
0 commit comments