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

while reading data from sqlite all the column names are coming in lower case in ionic app (IOS). #25

Closed
NeeteshSonkiya opened this issue Jun 6, 2020 · 2 comments

Comments

@NeeteshSonkiya
Copy link

I am trying to execute select query to read data from sqlite tables. but while reading data all the column names are coming in lower case in ios but its coming pascal case in android.

createtablequery = 'CREATE TABLE IF NOT EXISTS TestTable (ID varchar(255) NOT NULL PRIMARY KEY, FirstName varchar(255), LastName varchar(255),Address varchar(255),MobileNumber varchar(255));'

query = select * from TestTable ;
this.sqlite.query(query, values);

query result- (ios)
id, firstname, lastname, address, mobilenumber

query result- (android)
ID, FirstName, LastName, Address, MobileNumber

Please help me out to get same column name from sqlite table.
Thanks in advance

@jepiqueau
Copy link
Collaborator

@NeeteshSonkiya First thanks for using the plugin, Sqlite3 Swift doesn't make the differences between lastname, LastName, lastName so even if the column is created with LastName if you look at the database with an external tool like DBBrowser you can see LastName when you query like
SELECT LastName from TestTable
or
SELECT lastname from testtable
or
SELECT lastName from testTable
it is always returning the same .
To the contrary SQLite Java is case sensitive.
To get the same results from both Swift and Java the Swift query will have to parse all the resulting row and modify the column name when required meaning slowing down the whole process even for those who never use Capitalization letter.
So my answer will be to use a standard rules for naming which works for all the devices you want your application to work with meaning No Capitalisation letters
Hope this clarify, tell me if my answer suit you

@jepiqueau
Copy link
Collaborator

@NeeteshSonkiya This has been fixed in release 2.1.0, you can now use Capitalization characters in field name.

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

No branches or pull requests

2 participants