Skip to content

Commit f304a2a

Browse files
committed
Add get timestamp suffix
1 parent 1499fd6 commit f304a2a

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "json-schema-entity",
3-
"version": "7.0.21",
3+
"version": "7.0.22",
44
"description": "Manage a group of tables with a parent child relation in SQL that will be seen as a document, or entity, like a no SQL database",
55
"repository": "https://github.com/andrglo/json-schema-entity.git",
66
"author": {

src/index.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,12 @@ module.exports = function (schemaName, schema, config) {
13131313
get alias() {
13141314
return data.public.alias
13151315
},
1316+
get dialect() {
1317+
return config.dialect
1318+
},
1319+
get timestampsSuffix() {
1320+
return data.timestamps
1321+
},
13161322
get schema() {
13171323
return data.public.schema
13181324
},
@@ -1771,9 +1777,6 @@ module.exports = function (schemaName, schema, config) {
17711777
get alias() {
17721778
return identity.as
17731779
},
1774-
get dialect() {
1775-
return config.dialect
1776-
},
17771780
get schema() {
17781781
function buildSchema(data) {
17791782
var schema = data.schema

test/spec.js

+2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ module.exports = function (options) {
109109
})
110110
entityCadastro.setDialect(db.dialect)
111111
tableCadastro = entityCadastro.new(db)
112+
expect(tableCadastro.dialect).to.equal(db.dialect)
113+
expect(tableCadastro.timestampsSuffix).to.equal('test')
112114
tableCadastro2 = entityCadastro.new(db2)
113115
tableCadastro
114116
.createTables()

0 commit comments

Comments
 (0)