Skip to content

Commit baaa477

Browse files
committed
Remove outdated references to postgres
1 parent efbc4cb commit baaa477

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

sqlsynthgen/main.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ def _check_file_non_existence(file_path: Path) -> None:
3434
sys.exit(1)
3535

3636

37-
def _get_src_postgres_dsn(settings: Settings) -> str:
38-
"""Return the source DB Postgres DSN.
37+
def _require_src_db_dsn(settings: Settings) -> str:
38+
"""Return the source DB DSN.
3939
40-
Check that source db details have been set. Exit with error message if not.
40+
Check that source DB details have been set. Exit with error message if not.
4141
"""
4242
if (src_dsn := settings.src_dsn) is None:
4343
typer.echo("Missing source database connection details.", err=True)
@@ -105,8 +105,8 @@ def create_vocab(ssg_file: str = typer.Option(SSG_FILENAME)) -> None:
105105
def create_tables(orm_file: str = typer.Option(ORM_FILENAME)) -> None:
106106
"""Create schema from Python classes.
107107
108-
This CLI command creates Postgresql schema using object relational model
109-
declared as Python tables. (eg.)
108+
This CLI command creates the destination schema using object
109+
relational model declared as Python tables.
110110
111111
Example:
112112
$ sqlsynthgen create-tables
@@ -148,7 +148,7 @@ def make_generators(
148148
_check_file_non_existence(ssg_file_path)
149149
settings = get_settings()
150150
# Check that src_dsn is set, even though we don't need it here.
151-
_get_src_postgres_dsn(settings)
151+
_require_src_db_dsn(settings)
152152

153153
orm_module: ModuleType = import_file(orm_file)
154154
generator_config = read_yaml_file(config_file) if config_file is not None else {}
@@ -179,7 +179,7 @@ def make_stats(
179179
config = read_yaml_file(config_file) if config_file is not None else {}
180180

181181
settings = get_settings()
182-
src_dsn: str = _get_src_postgres_dsn(settings)
182+
src_dsn: str = _require_src_db_dsn(settings)
183183

184184
src_stats = asyncio.get_event_loop().run_until_complete(
185185
make_src_stats(src_dsn, config, settings.src_schema)
@@ -210,7 +210,7 @@ def make_tables(
210210
_check_file_non_existence(orm_file_path)
211211

212212
settings = get_settings()
213-
src_dsn: str = _get_src_postgres_dsn(settings)
213+
src_dsn: str = _require_src_db_dsn(settings)
214214

215215
content = make_tables_file(src_dsn, settings.src_schema)
216216
orm_file_path.write_text(content, encoding="utf-8")

sqlsynthgen/make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ async def make_src_stats(
464464
dictionary, using the differential privacy parameters set in the `smartnoise-sql`
465465
block of `config`. Record the results in a dictionary and returns it.
466466
Args:
467-
dsn: postgres connection string
467+
dsn: database connection string
468468
config: a dictionary with the necessary configuration
469469
schema_name: name of the database schema
470470

sqlsynthgen/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ def download_table(table: Any, engine: Any, yaml_file_name: str) -> None:
5252

5353

5454
def create_db_engine(
55-
postgres_dsn: str,
55+
db_dsn: str,
5656
schema_name: Optional[str] = None,
5757
use_asyncio: bool = False,
5858
**kwargs: dict,
5959
) -> Any:
6060
"""Create a SQLAlchemy Engine."""
6161
if use_asyncio:
62-
async_dsn = postgres_dsn.replace("postgresql://", "postgresql+asyncpg://")
62+
async_dsn = db_dsn.replace("postgresql://", "postgresql+asyncpg://")
6363
engine = create_async_engine(async_dsn, **kwargs)
6464
event_engine = engine.sync_engine
6565
else:
66-
engine = create_engine(postgres_dsn, **kwargs)
66+
engine = create_engine(db_dsn, **kwargs)
6767
event_engine = engine
6868

6969
if schema_name is not None:

0 commit comments

Comments
 (0)