Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[CLASS] SQLiteDB (now with BLOB and U64 support)


  • Please log in to reply
63 replies to this topic
just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011

Moved to www.ahkscript.org. Support will be continued there.


Edited by just me, 19 December 2013 - 09:23 AM.


Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
Great job! Thanks for sharing! :)

Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
Is it true that [charlist] wildcards can't be used in SQLite!?
Works":yqk5jf6v">

SELECT * FROM Test WHERE Name LIKE 'Näme%'

Does not work - [charlist">

wildcards":yqk5jf6v]SELECT * FROM Test WHERE Name LIKE 'N[aä]me%'

Another solutions that work":yqk5jf6v">

SELECT * FROM Test WHERE Name LIKE 'Name%' OR Name LIKE 'Näme%'
SELECT * FROM Test WHERE Name LIKE 'N_me%'



just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
http://www.sqlite.org/lang_expr.html

Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
Thanks. So no [charlist] wildcards in SQLite. :(


Another question;

Case-insensitive matching of Unicode characters does not work.

Case-insensitive matching of Unicode characters is a MUST HAVE for me. So should I use SQLite or not than? How to deal with it?

For example, let's execute the following statements in your sample database;

INSERT INTO Test Values('Marko','Đorđević','','')
INSERT INTO Test Values('Ivan','Karađorđević','','')
INSERT INTO Test Values('Pero','KarađorĐević','','')

Now, if I want to find all rows containing đorđe string in FName column, and use case-insensitive matching, my statment should look like this

SELECT * FROM Test WHERE FName LIKE '%ĐorĐe%' OR FName LIKE '%đorĐe%' OR FName LIKE '%Đorđe%' OR FName LIKE '%đorđe%'

Right? Is there any better way to deal with case-insensitive matching of unicode characters?

or maybe execute

SELECT * FROM Test WHERE FName LIKE '%_or_e%'

which matches đorđe, sorđe, morže, žorže, (etc. thousands of possible matches), and than filter results with AHK - remove all results than don't match đorđe (case-insensitive, of course)

Or some thing else? How to deal with it?
Or is the answer simply; If you need case-insensitive matching of Unicode characters, forget SQLite. :?

P.S. I know for "ICU" extension, but using that with SQLite is beyond my skills.

just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011

...with one of my favorite projects: SQLite.

may be mistakable, I'm not an expert in SQLite, my project is the wrapper class. But trying to answer your question:

Taking your example as real, i.e. mixing of cases within words is possible, I'd think there is no alternative for the "OR" operator.

pajenn
  • Members
  • 391 posts
  • Last active: Feb 06 2015 07:57 AM
  • Joined: 07 Feb 2009
thanks. i need to work with SQLite databases (albeit in visual basic), but i look forward to testing your script on them.

Hardware: fast laptop with SSD
Software: Win 7 Home Premium 64-bit, android for phone and tablet


IsNull
  • Moderators
  • 990 posts
  • Last active: May 15 2014 11:56 AM
  • Joined: 10 May 2007
Under which licence is this code released?

fincs
  • Moderators
  • 1662 posts
  • Last active:
  • Joined: 05 May 2007
I've skimmed through the code and I must congratulate you for producing such a well structured library! I am only going to nitpick about your assumption that pointers are always 4 bytes and fit in an UInt. This is not true in 64-bit AutoHotkey_L, but as there doesn't appear to be an official 64-bit Windows version of SQLite, then I think it's justified :lol:

sinkfaze
  • Moderators
  • 6367 posts
  • Last active: Nov 30 2018 08:50 PM
  • Joined: 18 Mar 2008

Under which licence is this code released?


It doesn't matter because the license wouldn't stand up to scrutiny in any court. Next.

IsNull
  • Moderators
  • 990 posts
  • Last active: May 15 2014 11:56 AM
  • Joined: 10 May 2007

Under which licence is this code released?


It doesn't matter because the license wouldn't stand up to scrutiny in any court. Next.


Actually it does matter for me, as "just me" aka "ich_L" aka "nick" etc.. has some strange ideas about usage rights on his code:

Moin IsNull,

ich möchte nicht, dass Du den Code von "[Class] SQliteDB" hier verwendest. Würdest Du also bitte so nett sein, Deine eigene Interpretation selbst zu schreiben?

en:

Hello IsNull

I don't want you to use my SQliteDB wrapper code in your code. Would you be so kind to write your own wrapper library?

Source


:roll:

I'm aware that this statement isn't anything valuable to law but I like to clarify that anyway :wink:

just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
Hello IsNull,

you forgot the link: DBA 0.3 (OOP-SQL DataBase in AHK {SQLite})

sinkfaze
  • Moderators
  • 6367 posts
  • Last active: Nov 30 2018 08:50 PM
  • Joined: 18 Mar 2008
@just me aka ich_l aka nick

If you don't wish to truly share your work, find a way to protect your source, or better yet, don't post it at an AHK forum. Don't come to these forums giving people the ins and outs of your code and then think you have the right to tell them when and how to use it. Not only is it not legally valid in virtually any country, it makes a mockery of the spirit of the forums. We are an "open source" community for a reason.

just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011
Edit: Nonsense!

just me
  • Members
  • 1496 posts
  • Last active: Nov 03 2015 04:32 PM
  • Joined: 28 May 2011

I am only going to nitpick about your assumption that pointers are always 4 bytes and fit in an UInt.


I cannot test in a 64-bit environment. So I do'nt know what happens, if a 64-bit pointers is passed to a 32-bit DLL. When you tell me that it's save, I will change "UInt" to "Ptr".