Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqliteError: no such table: main.old_profiles #1274

Closed
TheGP opened this issue Oct 9, 2024 · 2 comments
Closed

SqliteError: no such table: main.old_profiles #1274

TheGP opened this issue Oct 9, 2024 · 2 comments

Comments

@TheGP
Copy link

TheGP commented Oct 9, 2024

I got an error:

\node_modules\better-sqlite3\lib\methods\wrappers.js:5
        return this[cppdb].prepare(sql, this, false);
                           ^
SqliteError: no such table: main.old_profiles
    at Database.prepare (\node_modules\better-sqlite3\lib\methods\wrappers.js:5:21)
    at parsePhotos (file:///photo-filler/app.js:401:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///app.js:91:13 {
  code: 'SQLITE_ERROR'
}

The SQL for the error on line 401:

const insert = db.prepare('INSERT INTO photos (profileId, href, img, description) VALUES (@profileId, @href, @img, @description)');

@neoxpert
Copy link
Contributor

neoxpert commented Oct 9, 2024

SqliteError: no such table: main.old_profiles is an error caused by SQlite itself, not this library. I doubt that only this line is to blame for this error, as something tries to use the mentioned table. Also be aware, that the line number may be off if some transpiling / bundeling is happening.

@TheGP
Copy link
Author

TheGP commented Oct 9, 2024

It was a foreign key reference error.

@TheGP TheGP closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants