#1 2015-05-19 08:03:04

cypriotcalm
Member
Registered: 2015-02-18
Posts: 122

index creation in the mORMot

Hi ab,

I have also several questions about the index creation.

1. How can I enable or disable the automatic index creation? I mean the indexes which look like INDEX7CB68FFE350C6FF1(...)
2. How can I check through the ORM whether an index already exists?
3. How can I create my own indexes through the ORM?

Thank you for your answers!

Offline

#2 2015-05-19 08:28:59

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,206
Website

Re: index creation in the mORMot

Did you check the doc?

1. TSQLInitializeTableOptions
2. Index existence is checked at creation
3. TSQLRestServer.CreateSQLIndex or TSQLRestServer.CreateSQLMultiIndex

Offline

#3 2015-05-19 09:05:38

cypriotcalm
Member
Registered: 2015-02-18
Posts: 122

Re: index creation in the mORMot

Yes, I did check the doc ;-) But anyway thx for your help!

Offline

#4 2015-09-17 14:50:40

cypriotcalm
Member
Registered: 2015-02-18
Posts: 122

Re: index creation in the mORMot

I want to disable the auto creation of the indexes.

This code works!

  CreateModel
  VirtualTableExternalRegister

  fSQLRestServerDB.CreateMissingTables(0, [itoNoIndex4TID]);

But in this case the auto indexes are created:

  CreateModel
  VirtualTableExternalRegister
  
  fMySQLModel.Table[TMySQLTable.SQLTableName].InitializeTable(fSQLRestServerDB, 'SomeTIDFiled', [itoNoIndex4TID]);

  CreateMissingTables

Is there some issue?

Offline

#5 2015-09-17 18:36:48

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,206
Website

Re: index creation in the mORMot

You should not call the InitializeTable() directly as such.

InitializeTable() is called by CreateMissingTables.

Offline

Board footer

Powered by FluxBB