Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
You need to sign in or sign up before continuing.
Commit 80f8e0f2
authored
Feb 09, 2018
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
call clearTypeParser for all dialects
1 parent
301f6b80
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
21 deletions
lib/dialects/postgres/connection-manager.js
test/integration/data-types.test.js
lib/dialects/postgres/connection-manager.js
View file @
80f8e0f
...
...
@@ -61,6 +61,11 @@ ConnectionManager.prototype.$refreshTypeParser = function (dataType) {
}
};
ConnectionManager
.
prototype
.
$clearTypeParser
=
function
()
{
this
.
oidMap
=
{};
this
.
arrayOidMap
=
{};
};
ConnectionManager
.
prototype
.
getTypeParser
=
function
(
oid
,
format
)
{
if
(
this
.
oidMap
[
oid
])
{
return
this
.
oidMap
[
oid
];
...
...
test/integration/data-types.test.js
View file @
80f8e0f
...
...
@@ -17,28 +17,7 @@ var chai = require('chai')
describe
(
Support
.
getTestDialectTeaser
(
'DataTypes'
),
function
()
{
afterEach
(
function
()
{
// Restore some sanity by resetting all parsers
switch
(
dialect
)
{
case
'postgres'
:
var
types
=
require
(
'pg-types'
);
_
.
each
(
DataTypes
,
function
(
dataType
)
{
if
(
dataType
.
types
&&
dataType
.
types
.
postgres
)
{
dataType
.
types
.
postgres
.
oids
.
forEach
(
function
(
oid
)
{
types
.
setTypeParser
(
oid
,
_
.
identity
);
});
}
});
require
(
'pg-types/lib/binaryParsers'
).
init
(
function
(
oid
,
converter
)
{
types
.
setTypeParser
(
oid
,
'binary'
,
converter
);
});
require
(
'pg-types/lib/textParsers'
).
init
(
function
(
oid
,
converter
)
{
types
.
setTypeParser
(
oid
,
'text'
,
converter
);
});
break
;
default
:
this
.
sequelize
.
connectionManager
.
$clearTypeParser
();
}
this
.
sequelize
.
connectionManager
.
refreshTypeParser
(
DataTypes
[
dialect
]);
// Reload custom parsers
});
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment