#551 Re: mORMot 1 » Deploy mORMot server on IIS75+ » 2018-01-14 13:02:53

Great! A very helpful  reference!

#552 Re: mORMot 1 » Happy new year » 2018-01-03 05:37:07

Happy new year! I'm eager to see what improvements for mORMot will come in the new year! I'm especially excited about the linux server-side support smile

#553 Re: SyNode » SyNode for linux/FPC 3.1.1 status » 2017-12-21 15:22:19

That's great, MPV! The current SyNode is already a great achievement you have achieved!

#555 mORMot 1 » What would it take for mORMot to directly support HTTPS on Linux? » 2017-12-18 08:47:29

edwinsn
Replies: 3

Today I came across this go snippets, which directly support HTTPS (via let's encrypt) on the server side. Quite interesting, so I thought I'd posting it here as food for thought wink

package main

import (
    "crypto/tls"
    "golang.org/x/crypto/acme/autocert"
    "net/http"
)


func main() {
    certManager := autocert.Manager{
        Prompt:     autocert.AcceptTOS,
        HostPolicy: autocert.HostWhitelist("example.com"), //your domain here
        Cache:      autocert.DirCache("certs"), //folder for storing certificates
    }

    http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
        w.Write([]byte("Hello world"))
    })

    server := &http.Server{
        Addr: ":443",
        TLSConfig: &tls.Config{
            GetCertificate: certManager.GetCertificate,
        },
    }

    server.ListenAndServeTLS("", "") //key and cert are comming from Let's Encrypt
}

https://stackoverflow.com/a/40494806/133516

update 1: Synapse can do HTTPS on the server side: http://synapse.ararat.cz/doku.php/publi … ttpsserver

#556 Re: mORMot 1 » Interesting - 04 sample compiled with Delphi and running on Linux » 2017-12-07 17:39:55

Leslie, that's very true! Maybe the initial transition is kinda uncomfortable, but the gains afterwards will be gigantic in terms of extensibility and freedom.

#557 Re: mORMot 1 » Interesting - 04 sample compiled with Delphi and running on Linux » 2017-12-06 09:43:47

@Leslie7,

If we just talk about the cons (thus trying to overcome it), I think the biggest lost for a Delphi developer to transit to Lazarus is the **productivity lost** - the Change of the IDE, this lacking of the excellent IDE plugins such as MMX, GExperts, etc...

#559 mORMot 1 » Interesting - 04 sample compiled with Delphi and running on Linux » 2017-12-03 12:46:05

edwinsn
Replies: 5

Running using WINE, screenshot below. there is also a wineconsole command for running windows console programs. I haven't tested it further, although I deeply wish to develop with Delphi but this non-native approach must have some limits...
xubuntu

#560 Re: mORMot 1 » Some findings after spent an afternoon fiddling Linux/Lazarus/mORMot » 2017-12-01 08:00:05

update: xubuntu is so much faster and smoother than Linux Mint, which is already faster and smoother than the official Ubuntu desktop.

#561 Re: mORMot 1 » How to add sql order by in CreateAndFillPrepareMany » 2017-12-01 05:13:35

your ORDER BY statement seems to be correct. From the error message I guess it might doesn't related to the ORDER BY clause

Try remove "order by DispOrder" and try again to identify the source of the error first.

#562 Re: mORMot 1 » Difference between DTO and entity » 2017-11-29 16:47:16

I just use TSQLRecord-descendants, it feels handy, simple and no over-abstraction, and so far I don't see any drawbacks.

I know people must use DDD/DTO for a reason, but so far I feel it's a little over-abstraction for my own purpose, I might be wrong wink

#563 Re: mORMot 1 » Cannot compile TestSQL3 using Delphi 10.2 Starter » 2017-11-26 05:02:22

@mpv, if I'd create pull request, I'll use gitkraken, otherwise use tortoiseSVN.

#564 Re: mORMot 1 » Cannot compile TestSQL3 using Delphi 10.2 Starter » 2017-11-25 15:53:40

hi ab,

TortoiseSVN does the job so good except the above mentioned small glitch that I cannot avoid.

And feeling "so last century" is not the correct reason to avoid a handy tool, you know, Delphi/Pascal is much older than SVN, all after all, TortoiseSVN did not exist until 2002 smile

#565 Re: mORMot 1 » Cannot compile TestSQL3 using Delphi 10.2 Starter » 2017-11-25 07:36:53

Another possible reason - I usually checking out github repository with TortoiseSVN, and from time to time several lines of the .dpk file would become mangled, for example, "requires" would become "rrequire", "end" would become "nd".

I don't know why, just fix them manually.

#567 mORMot 1 » How to use 'notindexed' directive to exclude column from FTS4? » 2017-11-16 13:26:51

edwinsn
Replies: 2

Hello ab,

Sqlite FTS4 supports the 'notindexed' directive for excluding a specific column from indexing, when creating the table, for example:

CREATE VIRTUAL TABLE t USING FTS4(uuid, document, notindexed=uuid);

Some details here: https://stackoverflow.com/a/18531449/133516

How to achieve this for TSQLRecordFTS4Unicode61?

Thanks.

#568 SyNode » SpiderMonkey 24, 45 and 52 unit files confusion. » 2017-11-10 11:56:36

edwinsn
Replies: 0

I'm quite sure that **all files* related to the new Synode which is based on SpiderMonkey 52 is located in the 'SyNode' subfolder. And it seems that the new SyNode allow has support the the old SM45?

I'm quite sure the above is correct. But I've another observation I'm not certain of - The unit files for SM24 are located in the mORMot root folder, right? For example, SynSMAPI.pas, where I found the 'mozjs-24.dll' constant.

If so, I suggest to put all units related to SM24 into a sub-folder, to make things clear.

There are also sample projects still using SM24 in the '\SQLite3\Samples' sub-folder.

Just my 2 cents.

#571 Re: mORMot 1 » infra » 2017-10-26 13:40:14

whenever I read 'dom' I think of the html DOM or XML DOM wink

#572 Re: mORMot 1 » I need help again... » 2017-10-25 01:46:14

@esmondb, that's a good hint!

#573 Re: mORMot 1 » I need help again... » 2017-10-24 12:14:22

use SQLITE's JSON1 syntax.

#574 Re: mORMot 1 » Query on lot of records » 2017-09-15 16:00:49

To work around the situation oz described, I think only "ID > ?" should be used with the LIMIT keyword, instead of using "id>=? AND id<?".

Reference: http://sqlite.org/rowvalue.html#scrolli … ow_queries

#575 Re: mORMot 1 » Is this possible with an MVC server? » 2017-09-12 14:54:31

Hello,

So on the server-side function "/admin/resetpassword", instead of returning a HTML page, you return a JSON string, right?
Thanks.

#577 Re: mORMot 1 » Problem querying with DateTimeToSQL » 2017-08-30 10:35:01

@ab,

Well, after further testing, looks like the issue is not that DateTimeToSQL is not working, it DOES work.
But the SQL logged by the engine is not expected to be run by sample 12 - SynDB Explorer...

#578 Re: mORMot 1 » Problem querying with DateTimeToSQL » 2017-08-30 09:41:30

@ab,

Tried, it doesn't seem to work - without DateTimeToSQL, the TDateTime values in the resulting SQL look like this:

WHERE ((IsDisabled=:(0):) AND (StartTime <= :(42977.7362847222):) AND (EndTime >= :(42977.7362847222):))

#579 mORMot 1 » Problem querying with DateTimeToSQL » 2017-08-30 07:19:38

edwinsn
Replies: 3

Hello ab,

I hit by this issue several times, so I thought I should post it here smile

The issue is that,  following documentation https://synopse.info/files/html/Synopse … l#TITL_36), when querying with a TDateTime parameter wrapped by DateTimeToSQL, like following:

var
  svrTime: TDateTime;
  whereClause: string;
begin
  ...
  whereClause := '((StartTime <= ?) AND (EndTime >= ?)) ORDER BY Priority ';
  arbiPromoHdr := TSQLArbitraryPromo.CreateAndFillPrepare(aDb, whereClause, [DateTimeToSQL(svrTime), DateTimeToSQL(svrTime)]);
 ...
end;

It'll return no result. It seems that the problem is coming from the SQL generated by the engine, check this screenshot below, I got the SQL from the engine's log file:
SQL

I removed the sad:) prefix/postfix, the query still return no result.

The query will return the correct result, if I removed the mystery character before the datetime value, which I believe is JSON_SQLDATE_MAGIC

Not sure if I'm doing anything wrong, I followed the docs. I'll be appreciated if you can give me any hints.

#580 Re: mORMot 1 » any possible that mORMot Framework be acquired by embarcadero someday » 2017-08-16 04:43:24

That'll be a disaster for the mORMot project and its users.

#581 Re: mORMot 1 » Record generator tool » 2017-08-16 04:42:07

@linbren, I think it's been included in the official mORMot package: https://github.com/synopse/mORMot/tree/ … qlite-demo

#582 Re: mORMot 1 » Guidance needed » 2017-07-07 08:58:53

Since there are old databases not created by the mORMot framework, it'll make it hard to recreate mORMot's ActiveRecord objects. So if were you I'll do the following:

- Retrieve records from the source databases using TSQLTableJson;
- Use a TClientDataSet to consolidate all the 3 TSQLTableJson tables.
- Generate report from the data stored in the in-memory TClientDataSet.

#583 Re: mORMot 1 » Clear separation of components » 2017-07-07 08:44:21

That must involve a great amount of refactoring work, if ab go for it.

#584 Re: mORMot 1 » Clear separation of components » 2017-07-04 07:17:38

@ab,

I believe changing the name mORMot will take a lot of work and might introduce confusion since the name's been in use for so many years.

Maybe what we need is a simplified overview and getting started document written from a different perspective, or a lightweight wrapper around mORMot wink

#586 mORMot 1 » The latest SQLite Release is 3.19.3 On 2017-06-08 » 2017-07-02 09:03:52

edwinsn
Replies: 5

It fixes a bug about auto-vaccum and I suggest mORMot to upgrade.

http://sqlite.org/releaselog/3_19_3.html

#587 Re: mORMot 1 » How to get exclusive access to the DB (sqlite) via TSQLRestServerDB? » 2017-05-25 10:08:28

Hey Arnaud, I might be wrong, but since the rest db server is multi-threaded, will it possible for thread B to commit/rollback the transaction started by thread A? If yes, is it a design pitfall?

Sorry if I'm wrong.

#588 Re: mORMot 1 » How to get exclusive access to the DB (sqlite) via TSQLRestServerDB? » 2017-05-25 09:15:19

I think I should call fServer.Db.Lock to get exclusive access to the database server on the server-side.

Correct me if I'm wrong. Thanks.

#589 mORMot 1 » How to get exclusive access to the DB (sqlite) via TSQLRestServerDB? » 2017-05-24 16:45:10

edwinsn
Replies: 2

Hello Ab,

This is the second followup to this post: "cannot rollback - no transaction is active" error

I found new info - by looking at the logs, the error might caused by mix-up of **server-side** DB transactions (executed in a service method) and DB transactions initiated by batch operations, and I'll illustrate the problem with simplified pseudo code below - though I might be wrong.

// This is a server-side method that will query and update the db.
function TServerApi.ServerFuncA(): String;
var
  isLocalTrans: Boolean;
begin
  ...

  isLocalTrans := fServer.TransactionActiveSession < 1;

  try
    if isLocalTrans  then
      fServer.TransactionBegin;

    fServer.Upate(TSQLTableA, ...);
    // I guess the DB TRANSACTION has been committed by a batch-mode operation 
at this point, thus the following Commit command will fail, thus the exception's 
caught below and Rollback is called, thus causing the 
"cannot rollback - no transaction is active" error.

    if isLocalTrans then
      fServer.Commit;
  except
    if isLocalTrans  then
      fServer.Rollback;
  end;

  ...
end;

The issue is causing my server program to hang. One idea occur to me is to **lock** the DB access in the server-side method above, but how? Thanks.

#590 Re: mORMot 1 » Deploy mORMot HTTP Server on azure as SaaS » 2017-04-29 07:23:58

Yes, I agree with afarias, it's great to know about that!

BTW, this service is not very cheap, the pricing page is here:
https://azure.microsoft.com/en-us/prici … p-service/

#591 Re: mORMot 1 » Deploy mORMot HTTP Server on azure as SaaS » 2017-04-27 06:43:30

Actually I think you asked yourself in your question - "...made with .NET, PHP, NodeJS and JAVA." Obviously Delphi is not in the list.

#592 Re: mORMot 1 » Clone database using mORMot » 2017-04-25 08:40:46

@turrican, thanks for getting back to this thread and sharing the info with us. And yes, good to hear that, SQLite3 never failed us:)

#593 Re: mORMot 1 » Clone database using mORMot » 2017-04-21 06:11:33

I had the same curiosity - turning performance is always a good topic.

#594 Re: mORMot 1 » Telegram group » 2017-04-07 08:04:07

IMHO this forum is the best for this purpose - talks are publicly available and searchable by SE's. why another?

#596 mORMot 1 » Is there OnSuccess like TSQLRestClientURI.OnFailed? » 2017-03-17 12:08:37

edwinsn
Replies: 0

Hello Arnaud,

The use case would be:

Set the "connection is broken" flag in the OnFailed event handler, and reset the "connection is broken" flag in the OnSuccess event handler.

Or there is a better place else I missed for doing this kind of task? Thanks.

#597 Re: Free Pascal Compiler » Suggestion of make fpcupdeluxe docker image » 2017-03-08 14:59:38

Well, docker is a good idea - I can download it as a whole, in my country, internet censoring make it **never** success to get the the end of the process with fpcupdeluxe...

#598 Re: mORMot 1 » Epoll under linux » 2017-03-07 06:34:41

@Leslie7,

The excitement is coming from the expected performance improvement, right?

#599 Re: mORMot 1 » Confused by TSQLTable.RowFromID() » 2017-03-05 06:16:45

Thanks ab.

I was using it to locate the row index by ID value.

#600 mORMot 1 » Confused by TSQLTable.RowFromID() » 2017-03-04 07:14:58

edwinsn
Replies: 2

Hello Aranud,

The comment for the TSQLTable.RowFromID function:

    /// get the Row index corresponding to a specified ID
    // - return the Row number, from 1 to RowCount
    // - return RowCount (last row index) if this ID was not found or no
    // ID field is available
function RowFromID(aID: TID): integer;

I'm confused by this line:

return RowCount (last row index) if this ID was not found.

How to distinguish the situation where the ID value is found in the last row (which equals to RowCount), and "if this ID was not found" quoted above?

Thanks.

Board footer

Powered by FluxBB