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

SQL table name cannot start with numeric? #76

Closed
longxudou opened this issue Mar 31, 2020 · 1 comment
Closed

SQL table name cannot start with numeric? #76

longxudou opened this issue Mar 31, 2020 · 1 comment
Assignees
Labels

Comments

@longxudou
Copy link

longxudou commented Mar 31, 2020

What happens?

I met a bug when I try to convert the following json into sqlite file.

{
"2018Asset": [
{
"RANK": "1",
"id": "item_entertainment_18_212",
"count": "1billion"
}
]
}

What were you expecting to happen?

Convert succeed.

What are the steps to reproduce this issue?

command: sqlitebiter -o 'test.sqlite' file 'test.json'

Any logs, error output, etc?

I turn on the debug mode.
DEBUG | simplesqlite.core:create_table:1261 - CREATE TABLE IF NOT EXISTS '2018Asset' (RANK INTEGER, id TEXT, count TEXT)

Environments

  • **Operating System: macos mojave 10.14.6
  • Python Version: Python 3.7
  • **sqlitebiter Version: v0.31.0
  • **Installation Method: pip

Any other comments?

After detecting the table name starting with the number, the command should be 'CREATE TABLE IF NOT EXISTS [2018Asset] ...' instead of 'CREATE TABLE IF NOT EXISTS 2018Asset ...'.
We can escape the table's name by enclosing it with []:

@longxudou longxudou changed the title Meet a bug when table name start with the number like '2018Asset' SQL table name cannot start with numeric? Mar 31, 2020
@thombashi thombashi self-assigned this Apr 1, 2020
@thombashi thombashi added bug and removed needs-triage labels Apr 1, 2020
@thombashi
Copy link
Owner

@DreamerDeo
Thank you for your report.

The issue fixed at sqlitebiter 0.31.1, you can convert the JSON file with this version.
Please upgrade the package and re-execute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants