2024-07-09 16:33:38 -04:00
|
|
|
'use strict';
|
2025-03-18 14:52:07 -04:00
|
|
|
const {
|
|
|
|
SymbolDispose,
|
|
|
|
} = primordials;
|
2024-07-09 16:33:38 -04:00
|
|
|
const { emitExperimentalWarning } = require('internal/util');
|
2025-03-18 14:52:07 -04:00
|
|
|
const binding = internalBinding('sqlite');
|
2024-07-09 16:33:38 -04:00
|
|
|
|
|
|
|
emitExperimentalWarning('SQLite');
|
2025-03-18 14:52:07 -04:00
|
|
|
|
|
|
|
// TODO(cjihrig): Move this to C++ once Symbol.dispose reaches Stage 4.
|
|
|
|
binding.DatabaseSync.prototype[SymbolDispose] = function() {
|
|
|
|
try {
|
|
|
|
this.close();
|
|
|
|
} catch {
|
|
|
|
// Ignore errors.
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = binding;
|