✅ System.Data.SQLite Data Types
I'm wanting to save a float value to a relative database through the package System.Data.SQLite. I've not had to do this yet, and the docs for that package aren't much help.
55 Replies
so are you looking for an example...?
there isnt really a question
You'd do it like with any other variable
Do you want to use EF or just plain SQL?
apologies
this is my code so far
PayRate should be a float/double
I'm used to saving them as REAL in python sqlite3 markup
So... do
SQLite is SQLite
SQL is SQL
It doesn't magically gain new types just because you use it with C#
ok so then it would be a REAL then
Yes
oh ok. thank you very much 🙂
im pretty sure SQLite doesnt have the same datatypes for storage
i may be wrong
The same as what?
SQL
SQL is the language
SQLite is the database
SQL supports whatever types a given database has
i just felt my brain get bigger
Or rather, every database uses it's own flavour of SQL
[Password] VARCHAR(2048)
:pepesus:O_o what?
im sure its encrypted
haha
ok wait
right?
It better not be encrypted
It better be hashed
hashed*
totally knew that
I haven't learned encryption yet in C# and besides it's a locally hosted application. Like the database and files and such are local. Nothing backups online. Not even passwords
plaintext passwords are always bad
I like this dude 😂
ok so then how would I encrypt hash a password?
in python, we use salt
consider someone gets access to your PC and happens to find your database, and in your testing you used the same password you used for online accounts
SHA256 is supported in .NET by default
nah, screw hashing them, just use a
SecureString
And is... sufficient
I 100% understand your viewpoint, but my dev database passwords are always Test123! lmao
SecureString is sufficient?
SecureString is obsolete
securestring is ancient and not recommended
Deprecated, even
but just store it in a json file by serializing the instance
SHA256
is sufficientwe should use KWIC for passwords instead
Alternatively, use a BCrypt or Argon2id package if you want real security
ok I'm looking pulling up some sites on it now and I'll look into it when I get to that part
compress the password, base 64 it, then hash it
why
None of that is remotely necessary
Salt and hash
really confuse hackers, and open up more possibilities
Yeah nah
It's just useless work
my intentions are far beyond your understanding
If you're here just to meme then your intention better be to remove yourself from the conversation
ouch
side question for you if you don't mind.
my goal here is to add a new key value pair to the json file if it doesn't exist (check happens in previous function). I'm still not that familiar on working with a json file, but figured it better for this use case as i didn't see a use in creating a config table in the database folder.
You want a dictionary of dictionaries?
setupDict
is a Dictionary<string, bool>
well no
You can't just add a
Dictionary<string, string>
to itis the intended goal
That is not a dictionary
oh so ould it be
That is an object
If you want to throw away type safety and use
Dictionary<string, object>
, sure
But I'd recommend an object
Angius
REPL Result: Success
Console Output
Compile: 497.158ms | Execution: 44.993ms | React with ❌ to remove this embed.
ok cool. brb