You are not logged in.
I'm interested too. Currently I use TSQLRecord derived classes directly, and I'm satisfied with the concept and architectures.
The last time I read about the DDD (in the context of mORMot) and I wasn't convinced - I think it's over-complicated and over-engineering.
So I'm also interested to see how the cut-down version of DDD might look like.
Hello ab,
I'm glad you find this project useful and intend to extend mORMot with it - that will make mORMot a **distributed** system!
Re not supporting Windows, maybe you wait a little time, also for its maturity.
It seems to use a patched sqlite engine.
The "d" in dsqlite means distributed, from what I read, it allows your data to be automatically distributed into multiple servers, and if any of the servers is down, the data service will still keep working.
As a matter of fact, I don't think DSqlite can be easily integrated into mORMot.
Since you asked, in a perfect world, I want to program against mORMot's API, and my data to be transparently distributed in multiple nodes and take advantages of the multiple computing power.
@pvn0, actually it's quite different ![]()
Distributed SQLite but still embedded, by the company that made Ubuntu.
No sure how difficult it'll be to integrate it with mORMot ![]()
project site: https://github.com/canonical/dqlite
I like that the engine's very small in size, runs JS quickly, and fully supports the ES2019 spec!
Hello ab,
I'm having trouble fixing a memory leak caused by a variant variable. I'm wondering if you have any suggestions.
The procedure which is something like:
var
v: Variant;
begin
TDocVariant.NewFast(v);
v.SomeString := 'testString';
AnotherProc(v);
end;The following are one of memory leak report by madExcept:
type: GetMem
address: $15b33c28
size: 27
access rights: read/write
thread $7fc (TMyWorkerThread):
671c90b2 madExcept32.dll madExceptDbg 1603 GetMemCallback
00406c74 app1.exe System 4189 @GetMem
006d7196 app1.exe SynCommons 20604 FastSetString
006d55f6 app1.exe SynCommons 18893 RawUnicodeToUtf8
006f4339 app1.exe SynCommons 43865 TSynInvokeableVariantType.SetProperty
00470ab2 app1.exe System.Variants 6340 TInvokeableVariantType.DispInvoke
00466b60 app1.exe System.Variants 930 DispInvokeCore
00466bc2 app1.exe System.Variants 953 @DispInvoke
012fbcda app1.exe MyUnit1 309 TMyClasss.LoadRenderingContext
...
00d740e1 app1.exe EyThreadPool 436 TEyExecProcWorkItem.Execute
00d73db1 app1.exe EyThreadPool 378 TEyWorkerThread.Execute
004b002b app1.exe madExcept 17436 HookedTThreadExecute
00541366 app1.exe System.Classes 14548 ThreadProc
0040b9d8 app1.exe System 22016 ThreadWrapper
004aff11 app1.exe madExcept 17369 CallThreadProcSafe
004aff76 app1.exe madExcept 17419 ThreadExceptFrame
75ab343b kernel32.dll BaseThreadInitThunk@Vitaly,
Thanks for your comments.
It's good to know about the useful `TEnumType` type and your real-life experience with it.
But If I understand the OP correctly, he wants the parameters of type enum of an interface-based service to be transfer by the framework in the format of strings instead of integer values, as far as I know it's not possible?
I just checked the "Service Methods Parameters” chapter of the document, it states that all enum values are being transferred as JSON numbers, not sure if there is an option to configure/change that.
I believe converting and transferring the enum values in their string presentations would significantly reduce the performance.
I agree with ab. One of the beautiful things about JSON is that it's human-readable and it has a huge advantage when debugging or testing.
yes, thanks ab!
@ab, since my previous PR didn't get you noticed until a few days later, so I'm not sure if you really monitors the github PR notification, and to avoid my local repository to fall behind your repository, I'm notifying you this pull request, and if it makes sense, I wish you can merge it ASAP.
The PR fixed: `TDocVariantData.B` or `GetBooleanByName` couldn't correctly handle the "true" and "false" JSON values.
Just in case anyone of you find my contribution workflow is not optimized:
- I have two local repository:
- 'mORMotOfficial': which is exactly the official mORMot repository.
- 'mORMotFork': For pushing to my github repository.
- When I need to make a change I work in the 'mORMotOfficial' folder, once passed tests I sync it to the sibling 'mORMotFork' folder, which will then be pushed to my github fork of the mORMot repository. Then I create pull request to @ab.
So if the official mORMot repo has new commits, I'll have to:
- sync my fork on github
- pull my fork to local
- backup my changes to somewhere else and pull the official repo to local
- re-apply my changes to both the local fork and working folders
- push again to github
So that's why I'm afraid of falling behind the official repo after I created a new PR ![]()
Thanks.
@EMartin, FPC is compiler while Lazarus is the IDE, so I guess the compilation error has nothing to do with Lazarus.
I just checked my fpcupdeluxe installation and it's Lazarus 2.1 which was installed many months ago.
And I just checked it was able to compile the mORMot I checked out few days ago.
@hnb,
Do you know where I can find descriptions for all these "versions"? Is "fixes3.2" the most recent AND stable release?
I know 'trunk' is the latest but not stable, but the 'stable' release is too far behind and sometimes cannot compile mORMot.
All I want is to choose the most recent but ALSO stable enough release to work with mORMot, is "fixes3.2" currently the best suit? Thanks.
Nice feature!
Definitely it's the issue of the anti-virus software...
@ab, one more question - does the 'KDFRounds' parameter for the encryption and decryption has to be the same?
I mean if the rounds are not the same, will it cause decryption fails?
I see, Your approach is a quite customized one. But I fully agree that the system must be tolerant.
@macfly, thanks for sharing, it's very insightful.
Re "Today I control the licenses online. Each time a user requests the registration the server checks how many requests it has made in the last x days and if it detects abuse it blocks, and warns me.", have you implemented any kind of "deactivation" operation for the end user?
> ExtractFileName(Application.ExeName) can be a good idea
All your code can be changed. ;-)
Do not invent sec - rely on cryptography.
GUID here is something. It may be changed for Major releases etc.
There is no reason to prevent user from renaming executable. I think that relying on executable name is bad practice.
Agreed, actually after thinking deeper after my previous reply, I had the same conclusion with you ![]()
Thanks @ab, as always, your help comes fast!
Ah I see! Assuming in the scenario of implementing a 'software activation' system, it seems that the `aSecretPass` parameter is perfect suitable for accepting the serial number the customer purchased?
For `aDPAPI` and `aDecryptSalt`, I just had an idea - it seems that ExtractFileName(Application.ExeName) can be a good idea, because that can prevent the bad people from changing the program's file name ![]()
PS, you meant "some non-empty constant strings", right ![]()
@ab,
I'm just starting looking at `ECCAuthorize`, my question is, will it decrease the security level if I pass empty string '' for all the `aSecretPass`, `aDPAPI`, `aDecryptSalt` three parameter?
I want to simplify things, since this approach is based on asymmetric encryption I think that's enough - I'll keep the 'app locking private key' secretly and that'll be enough. Am I wrong? Thanks.
ab wrote:The idea is that you supplied some needed information as aContent: TObject output, encrypted as JSON within the .unlock file.
If you let ECCAuthorize return 0, the system won't work.Well, that changes everything: return 0 and {"godmode":"on"} in aContent
What is the difference with "strong" https request of the same content?
I think you misunderstand the purpose of the approach @ab is introducing here, It's the Code Signing's task to protect the EXE file from being tampered.
I guess implementing a GraphGL server would be very complex. The wikipedia page says GraphGL is not suitable for simple API.
Use ExecuteList which returns TSQLTableJSON.
Use TStringList to store the value list, and use json_each to query. Check: https://www.sqlite.org/json1.html
Can you install Lazarus on your Centos and debug?
Really interesting question.
What do you mean by not having control of the server? Is the server also based on mORMot?
A thought:
- Pause the client, then perform the table rotating (renaming) on the db level (not the ORMot leve), empty the cache (both the client and server side), and resuming using the clients.
I agree with Bsaidus ![]()
if the db is sqlite, I think all write operations to the db are coordinated with a lock, which means it's thread-safe but the writes are not parallel.
I don't think it's possible with SQLite?
@edwinsn I'm from Brazil.
Another issue, the Indy server to download SSLs is protected by captcha for me.I saw in fpcupdeluxe thread that this is not for everyone.
Certainly the servers are acting differently according to the IP location.
Since the source check out process need to download a lot of files, and given the fact that SVN is not very fast, to me it's more like a technical issue on the server side.
@macfly, where are you in? Yes, in China here without an "extended" VPN the svn check out most likely will fail.
Found the answer from the document: "Partials are rendered at runtime (as opposed to compile time), so recursive partials are possible. Justavoid infinite loops. ".
So the answer is YES.
Yes, SVN is much slower than git.
With the Dmustache template engine, can I call a partial recursively?
The case is generating multi-level sub-menus, where the levels of the menus are dynamic.
From this stackoverflow question (https://stackoverflow.com/a/31927431/133516), the official JS mustache does support recursive calling of partials.
Thanks.
I insist that the ORM processing will slow your mORMot testing code down. Publish your testing code into a github repository.
I think he looked at the first post of the thread: "Sticky: My mORMot Videos by warleyalex"
Because it's a fixed post, it stays at the top regardless of the date, and the last post was in 2018.
I think you are correct, in the mORMot sub-forum 'above the fold' all are old posts, while 'below the fold' all are new posts
![]()
restClient.Server.DB.Synchronous := smOff;
restClient.Server.DB.LockingMode := lmExclusive;guess maybe helpful?
I don't think so. The looking mode and synchronous setting are only affect on-disk db file, but not in-memory db.
Hey you must be missing something, it's not possible the last post is dated Dec 2018
Your mORMot testing code uses the ORM, while the UniDAC testing code access the db directly, it's not a fair comparison. Use ISQLDBStatement (from SynDb.pas) instead.
Don't be afraid, once you pass the initial learning stage, the gaining will be BIG ![]()
general samples: https://github.com/synopse/mORMot/tree/ … e3/Samples
Re. example usage for SynCrypto, check function Cypher in <mORMot>\SQLite3\Samples\MainDemo\FileEdit.pas
ab, even this's a very minor issue, u respond as fast as always
I've been visiting this forum for many years and to be honest I've never noticed nor used the 'Jump to' navigation links ![]()
BTW, I always use the github repo for getting updates.
I guess SQLiteStudio cannot recognize some of the mORMot collations? I use SQLite Studio for querying only, never dare to perform actions like that with it.
I actually declaring a classes inheriting from TSQLAuthUser/Group and add it to the model, but what you did should also work.
I'm using Delphi only, with sqlite db. maybe you can debug into the CreateMissingTables method.
Include TSQLAuthUser and TSQLAuthGroup in your database model, something like:
TSQLModel.Create([TTicket, TSQLAuthUser, TSQLAuthGroup],'root');
MongoDB has a replication system, with automatic election IIRC.
You can build anything on top of assembly, too.
It may be a very good tool, but my guess (perhaps I am wrong) is that it would demand a lot of work to have a proper driver, and proper ORM integration - even for basic tasks.
FoundationDb distributed feature is much more than replication. Check out this extremely impressive video:
https://www.youtube.com/watch?v=oLGYMdo2q2g
I believe when its first come out, nothing like that on the earth, and one of the reasons it's acquired by Apple than released being an open source project 3 years later.
Re possible integration with mORMot, yes, I believe it's not easy, I asked implementing it using SQLIte's Virtual table approach, the developer of foundationdb said it's not scaleable in that way.
Finally it worked
I could also reduce it to:
Baby := TSQLBaby.CreateAndFillPrepare( aClient, 'BirthDate=?',[double(dt)]);So you may ask... Why all this about using DateToSQL and DateTimeToSQL when you should cast it to a double?
It has to be some other situations when you need to use them but when?PS
Is there any Convention how to mark a thread solved here ?
DS
It's not very normal that the datetime values are stored as Double, what type is TSQLBaby.BirthDate? If it's defined as either TDateTime or TDate, and if the saving is done via mORMot, the field values stored to the db should be something like @AOG posted, in iso8601 format, by design of the framework, check the doc here.
I usually edit the forum post and add '[solved]' to the title.
Hi ab, I must say I don't have real-life project with both of the two, but here are several perceptions I got reading on Hacker News:
- MongoDB might be far less stable than FondationDB - I used to watch a demo video on youtube by one of the FoundationDB co-founders, there were 4 or 5 nodes running the distributed FondationDB system, you randomly turn off two of them, and in just a minute, the distributed system automatically restore to full working service. It's very impressive, nothing like that in the market as far as I know.
- You can built anything on top of FondationDB's layer system, that's the goal of its fundamental key-value system.