pwwang / pymedoo

A lightweight database framework for python
MIT License
15 stars 4 forks source link

Sqlite not creating database file #7

Closed pwwang closed 4 years ago

pwwang commented 4 years ago

Hi,

I found sqlite engine stop working after the latest update. This code snippet will not create the db file. If I run it with earlier version to create the db file, and run it again with 0.0.6, print(tables) will print [].

from medoo import Medoo

db = Medoo(dbtype="sqlite", database="z:\\test.db")
tables = db.query("SELECT name FROM sqlite_master WHERE type='table';")
tables = [x['name'] for x in tables.all()]
print(tables)
if 'books' not in tables:
    db.query('''create table books
        (id integer primary key,
        title varchar(25) not null default '',
        author varchar(6) not null default ''
        );''')

Originally posted by @qijianjun in https://github.com/pwwang/pymedoo/issues/6#issuecomment-644268640

pwwang commented 4 years ago

See: https://github.com/pwwang/pymedoo/commit/cdc77906f32e7c6dfc135043cdc5a10a7bebef37#r39922537 Will fix soon.

pwwang commented 4 years ago

FIx at v0.0.7