SqLite Metadata information

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SqLite Metadata information

K, Rajasekar
Hi All,

I am currently working on a project where I am using "SqLite" database to store some data. And I need to get some information about the database I have created.
Information like

1.       Charset - character set used in the database

2.       Collation - Collation method used in the database

3.       Encryption - Encryption method used in the database

4.       Casesensitve - Case sensitive details

Can I get all of these details ablout the database? If not can I get little info.

I am not sure how to get all these details and I have checked the sqlite_master table this doesn't give any info.

Is there any build in functions that will give me these details?

I have used C# to create database.

With best regards,
Rajasekar K

Siemens Technology and Services Private Limited
CT DD DS AA TEC AU UI
84, Hosur Road
Bengaluru 560100, India
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SqLite Metadata information

Simon Slavin-3


On 21 Sep 2017, at 3:21am, K, Rajasekar <[hidden email]> wrote:

> Information like
>
> 1.       Charset - character set used in the database
> 2.       Collation - Collation method used in the database
> 3.       Encryption - Encryption method used in the database
> 4.       Casesensitve - Case sensitive details
>
> Can I get all of these details ablout the database?

Charset is database-wide:

<https://sqlite.org/pragma.html#pragma_encoding>

There’s no way to find out encryption.  Many installations of SQLite don’t support it at all.  When it is supported it might be by several different encryption systems, and there’s no standard way to figure out which one it is.  The makers of SQLite developed one of the encryption methods, but I have no idea whether that’s frequently used in comparison with others.

<https://www.hwaci.com/sw/sqlite/see.html>

Collation and case sensitivity (called NOCASE in SQLite) are set for each column, though they can be overridden in places which refer to those columns, e.g. indexes and comparisons.  You can find out some things

<https://sqlite.org/pragma.html#pragma_collation_list>
<https://sqlite.org/pragma.html#pragma_table_info>
<https://sqlite.org/pragma.html#pragma_index_xinfo>

but neither collation nor case sensitivity apply to the database as a whole.

Your question suggests that you are not familiar with SQLite, and that you’re interested in information about databases created by other people, not by yourself.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SqLite Metadata information

Clemens Ladisch
In reply to this post by K, Rajasekar
K, Rajasekar wrote:
> I need to get some information about the database I have created.

Why?  What problem are you going to solve with this information?


In addition to Simon's remarks:

> 1.       Charset - character set used in the database

Please note that this setting affects only how text values are
internally stored in the database file, but _not_ the encoding of values
as seen by your program.

> 3.       Encryption - Encryption method used in the database

If you have successfully opened the file, you already know.  If you have
not yet opened it, you cannot know.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SqLite Metadata information

David Raymond
In reply to this post by K, Rajasekar
1.       Charset - character set used in the database
http://www.sqlite.org/pragma.html#pragma_encoding
Though as someone mentioned this is just the internal representation, and not necessarily what you'll get back from your language of choice.

2.       Collation - Collation method used in the database
http://www.sqlite.org/datatype3.html#collating_sequences
Collation is defined on a per-field level and there are 3 built-in ones. The only place this info is stored is in the sql text in sqlite_master and needs to be parsed out to examine it.
http://www.sqlite.org/pragma.html#pragma_collation_list can tell you if there's anything more than the standard 3 defined.

3.       Encryption - Encryption method used in the database
Part of the security is not telling you :p

4.       Casesensitve - Case sensitive details
http://www.sqlite.org/datatype3.html#collating_sequences
NOCASE is one of the collating sequences, the rules for which collating sequence wins in any particular comparison are in there.
http://www.sqlite.org/pragma.html#pragma_case_sensitive_like
This doesn't actually have a form that gives you the current setting, which kind of sucks, but does let you set it yourself.


Know that in SQLite there are a lot of things which are left to the accessing connection and whatever it was compiled with or set up with. Even enforcing foreign key constraints is a connection-level thing which defaults to off for example.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users