You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying a little bit of code I get the following error
error TS7016: Could not find a declaration file for module 'mariadb/callback'. 'D:/Programming/Vagrant/sites/test1.test/web/node_modules/mariadb/callback.js' implicitly has an 'any' type.
Try npm i --save-dev @types/mariadb if it exists or add a new declaration (.d.ts) file containing declare module 'mariadb/callback';
Trying to install mariadb types via the suggested command also fails as it is not found.
A side note, running the generated code from the typescript below will display the records in the specified table, but the last two lines are not executed. The application does not seem to continue. I expected it to run, display the 2 rows in the given table and exit.
** Typescript **
`import {createConnection} from "mariadb/callback";
Node version: v22.6.0
Mariadb connector: v3.3.2
Running Debian v12
MariaDB version: 11.5.2-MariaDB-deb12
When trying a little bit of code I get the following error
error TS7016: Could not find a declaration file for module 'mariadb/callback'. 'D:/Programming/Vagrant/sites/test1.test/web/node_modules/mariadb/callback.js' implicitly has an 'any' type.
Try
npm i --save-dev @types/mariadb
if it exists or add a new declaration (.d.ts) file containingdeclare module 'mariadb/callback';
Trying to install mariadb types via the suggested command also fails as it is not found.
A side note, running the generated code from the typescript below will display the records in the specified table, but the last two lines are not executed. The application does not seem to continue. I expected it to run, display the 2 rows in the given table and exit.
** Typescript **
`import {createConnection} from "mariadb/callback";
const conn = createConnection({
host: 'localhost',
database: 'database',
user:'username',
password: 'password',
port: 3306
});
conn.connect(err => {
if (err) return console.log("Failed to connect");
console.log(
Successfully connected to mariadb server: ${conn.servername}
);});
console.log(conn.info);
conn.query("SELECT * from company", (err, rows) => {
console.log('Results:')
console.log(err); //[ {val: 1}, meta: ... ]
console.log(rows); //[ {val: 1}, meta: ... ]
});
conn.end();
console.log('test');
`
** Generated Code **
Object.defineProperty(exports, "__esModule", { value: true }); const callback_1 = require("mariadb/callback"); const conn = (0, callback_1.createConnection)({ host: 'localhost', database: 'databases', user: 'username', password: 'password', port: 3306 }); conn.connect(err => { if (err) return console.log("Failed to connect"); console.log(
Successfully connected to mariadb server: ${conn.servername}); }); console.log(conn.info); conn.query("SELECT * from company", (err, rows) => { console.log('Results:'); console.log(err); //[ {val: 1}, meta: ... ] console.log(rows); //[ {val: 1}, meta: ... ] }); conn.end(); console.log('test');
The text was updated successfully, but these errors were encountered: