diff --git a/README.md b/README.md index f4b9112..84e1b62 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ table name `student` and rows `student_id`, `student_name` with datatypes integer and text, respectively. The default value for `student_name` is `John Smith`. -##Basic Usage +## Basic Usage ### Entry manipulation diff --git a/datalite/datalite_decorator.py b/datalite/datalite_decorator.py index 60b6ff5..ad32add 100644 --- a/datalite/datalite_decorator.py +++ b/datalite/datalite_decorator.py @@ -27,7 +27,8 @@ def _create_entry(self) -> None: try: cur.execute(f"INSERT INTO {table_name}(" f"{', '.join(item[0] for item in kv_pairs)})" - f" VALUES ({', '.join(_convert_sql_format(item[1]) for item in kv_pairs)});") + f" VALUES ({', '.join('?' for item in kv_pairs)})", + [_convert_sql_format(item[1]) for item in kv_pairs]) self.__setattr__("obj_id", cur.lastrowid) con.commit() except IntegrityError: