1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 18:18:53 +08:00

move sql parsing to dataBase module

This commit is contained in:
lana-k
2020-12-27 18:30:43 +01:00
parent 34764a6e33
commit dc3979584c
3 changed files with 64 additions and 50 deletions

View File

@@ -30,10 +30,14 @@ describe('dataBase.js', () => {
const buffer = new Blob([data])
return db.loadDb(buffer)
})
.then(schema => {
.then(({dbName, schema}) => {
console.log(schema[0].columns)
expect(schema.length).to.equal(1)
expect(schema[0][0]).to.equal('test')
expect(schema[0][1]).to.equal('CREATE TABLE test (col1, col2)')
expect(schema[0].name).to.equal('test')
expect(schema[0].columns[0].name).to.equal('col1')
expect(schema[0].columns[0].type).to.equal('N/A')
expect(schema[0].columns[1].name).to.equal('col2')
expect(schema[0].columns[1].type).to.equal('N/A')
})
})
})