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

dbrestore of sqlite database does not like newlines #238

Closed
setphen opened this issue Apr 10, 2017 · 2 comments
Closed

dbrestore of sqlite database does not like newlines #238

setphen opened this issue Apr 10, 2017 · 2 comments
Assignees
Labels
bug Bugs that need to get fixed. db/sqlite

Comments

@setphen
Copy link

setphen commented Apr 10, 2017

I get a UserWarning when running dbrestore for an sqlite database:

UserWarning: Error in db restore: unrecognized token:
And then a print of some text I have entered in a field. This only happens on Textfields that have line breaks. The rest of the db restore seems to work as expected.

Python 3.4

@davidfokkema
Copy link

+1

@ZuluPro ZuluPro self-assigned this May 7, 2017
@ZuluPro ZuluPro added bug Bugs that need to get fixed. database db/sqlite labels May 7, 2017
rgaiacs added a commit to rgaiacs/django-dbbackup that referenced this issue Aug 18, 2017
On Textfields that have line breaks, sqlite reports "unrecognized token"
because it doesn't keep the previous line in memory to be ammended by
the current line.

This pull requests implements a very simple logic to only send SQL
INSERT commands when the line finished with ");".

Close jazzband#238
rgaiacs added a commit to rgaiacs/django-dbbackup that referenced this issue Oct 16, 2017
On Textfields that have line breaks, sqlite reports "unrecognized token"
because it doesn't keep the previous line in memory to be ammended by
the current line.

This pull requests implements a very simple logic to only send SQL
INSERT commands when the line finished with ");".

Close jazzband#238
rgaiacs added a commit to rgaiacs/django-dbbackup that referenced this issue Oct 17, 2017
On Textfields that have line breaks, sqlite reports "unrecognized token"
because it doesn't keep the previous line in memory to be ammended by
the current line.

This pull requests implements a very simple logic to only send SQL
INSERT commands when the line finished with ");".

Close jazzband#238
@jonathan-s
Copy link
Contributor

Conversation moved to #254

dimara added a commit to dimara/keda that referenced this issue Apr 9, 2024
Trying to dbrestore fails with tons of unrecognized token.
It breaks if trying to INSERT values that have new line [1].
Use [2] as workaround.

[1] jazzband/django-dbbackup#238
[2] rgaiacs/django-dbbackup@841d9cd

Signed-off-by: Dimitris Aragiorgis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs that need to get fixed. db/sqlite
Projects
None yet
Development

No branches or pull requests

4 participants