#2 mORMot 2 » Creating a TRestServerDB in mORMot2 to work with an external MS SQL » 2025-10-14 09:34:54

FlaviusFX
Replies: 3

I am looking at using mORMot2 for a large Delph 12/13 archaeological project for an HTTPS REST server to start with. This a major project to modernise operations.

I am in the procssing of build a small prototype

HTTPS Rest server that connects to our MS SQL databases.
Clients from Delphi VCL, Andriod FMX apps and web pages.

Creating a TRestServerDB in mORMot2 to work with an external MS SQL database involves two main steps:
1. Instantiate TRestServerDB using an in-memory SQLite database as its internal ORM kernel. You can use :memory: as the database name for this purpose.
2.Register your existing MS SQL tables with the mORMot2 framework using VirtualTableExternalRegister.

Is this approach correct to use its native SQLite ORM capabilities while routing read and write operations to your external MS SQL database?

Does the below look right?

https://gist.github.com/FIFernandes

#3 Re: mORMot 2 » mORMot2 (2.3 stable) fail to create x64 package » 2025-10-09 14:10:25

zed wrote:

@FlaviusFX I think you should use the source from the lts-2.3 branch. It contains backported fixes for bugs that were discovered after the 2.3 stable release.

Thank you very much for this, I got the

Total assertions failed for all test suits:  0 / 172,429,898
! All tests passed successfully.

#4 Re: mORMot 2 » mORMot2 (2.3 stable) fail to create x64 package » 2025-10-09 08:45:33

Thank you all for the quick reply. @flydev

In unit mormot.db.raw.sqlite3.static; I added the memchr function and it can compile.
I hope this will allow me to do some tests and get me started using mORMot2.
I want to recommend mORMot2 to a large organisation, so I hope all evaluations for smoothly. So any help I get would be appreciated.

{$endif CPU32}

function memchr(p: pointer; c: byte; n: PtrInt): PAnsiChar; cdecl;
begin
  result := P;
end;

When i run the tests

WARNING: deprecated SQLite3 engine
------------------------------------

Static SQLite3 library as included within S:\Delphi Github\mormot2\test\mormot2tests.exe is outdated!
Linked version is 3.46.1 whereas the current/expected is 3.44.2.

Please download latest SQLite3 3.44.2 revision from
https://synopse.info/files/mormot2static.7z


1.7. Network protocols:
  - TUriTree: 9,245 assertions passed  2.13ms
     1000 big tree lookups in 209us i.e. 4.5M/s, aver. 209ns
     1000 URI lookups in 41us i.e. 23.2M/s, aver. 41ns
     1000 URI static rewrites in 109us i.e. 8.7M/s, aver. 109ns
     1000 URI parametrized rewrites in 151us i.e. 6.3M/s, aver. 151ns
     1000 URI static execute in 118us i.e. 8M/s, aver. 118ns
     1000 URI parametrized execute in 219us i.e. 4.3M/s, aver. 219ns
!  - DNS and LDAP: 3 / 1,070 FAILED  81.70ms
     time.google.com : 2025-10-09 09:17:54.655Z = 2025-10-09 09:17:54.632Z
  - RTSP over HTTP: 1,900 assertions passed  247.64ms
  - RTSP over HTTP buffered write: 1,900 assertions passed  253.34ms
  - TTunnelLocal: 9,120 assertions passed  228.76ms
  - IP addresses: 53 assertions passed  372us
  - THttpPeerCache: 14,013 assertions passed  241.72ms
     2000 messages in 732us i.e. 2.6M/s, aver. 366ns, 500.2 MB/s
     10000 altered in 274us i.e. 34.8M/s, aver. 27ns, 6.5 GB/s
  Total failed: 3 / 37,301  - Network protocols FAILED  1.05s

#5 Re: mORMot 2 » mORMot2 (2.3 stable) fail to create x64 package » 2025-10-08 11:44:22

Hi
I am getting the error [dcc64 Error] mormot.db.raw.sqlite3.static.pas(1303): E2065 Unsatisfied forward or external declaration: 'memchr' when trying to compile mormot2tests

I am running Delphi 12.3
-mORMot 2.3 stable
- I have download associated mORMot 2.3.stable static binaries .7z and extract it into the static sub-folder of local source

When i serach in  mormot.db.raw.sqlite3.static.pas I canot see any reference to mmemchr.

Can someone help please?

Board footer

Powered by FluxBB