Re: [fpc-pascal] Database Metadata proposal

2014-06-01 Thread Michael Van Canneyt



On Sat, 31 May 2014, Daniel Gaspary wrote:


Hi.

  In December 2012, this[1] thread has brought some ideas about
Database metadata, in special the retrieving of Schema names.

  This[2] wiki page summarizes what was discussed.  Some further
conclusion after that thread?

  I agree that using Information schema, wherever is supported, is
the best solution.

  I propose the following types and methods:

   TSqlObjectIdenfier = class
   public
 property SchemaName: String;
 property ObjectName: String;

 //Optional / Reuse TSchemaType?
 property SqlObjectType: TSqlObjectType;
   end;

   TSqlObjectList = specialize TFPGList;


Make this a TCollection/TCollectionItem. 
Generics are not used in the DB units, and they should not be used for consistency.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Database Metadata proposal

2014-06-01 Thread Daniel Gaspary
On Sun, Jun 1, 2014 at 5:27 AM, Michael Van Canneyt
 wrote:
> Make this a TCollection/TCollectionItem. Generics are not used in the DB
> units, and they should not be used for consistency.

But I was thinking that TSqlObjectIdenfier could be reused at Data
Dictionary Units. As a TCollectionItem could be harder to reuse, as it
will depend of the existence of a TCollection.

Maybe using Record instead of a class?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Database Metadata proposal

2014-06-01 Thread Michael Van Canneyt



On Sun, 1 Jun 2014, Daniel Gaspary wrote:


On Sun, Jun 1, 2014 at 5:27 AM, Michael Van Canneyt
 wrote:

Make this a TCollection/TCollectionItem. Generics are not used in the DB
units, and they should not be used for consistency.


But I was thinking that TSqlObjectIdenfier could be reused at Data
Dictionary Units. As a TCollectionItem could be harder to reuse, as it
will depend of the existence of a TCollection.


I don't understand what you mean with this sentence ?

1. TCollectionItem can perfectly be used without TCollection.
2. You create the collection implicitly with your generic list anyway;
   the exercise is pointless without it; so why not be explicit ?

But if you feel more comforable with a record and an dynamic array: 
feel free to use that. Though I don't see a problem with TCollectionItem/TCollection.

It is used everywhere in the FCL.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Database Metadata proposal

2014-06-01 Thread silvioprog
2014-06-01 11:18 GMT-03:00 Michael Van Canneyt :
>
> On Sun, 1 Jun 2014, Daniel Gaspary wrote:
>
>> On Sun, Jun 1, 2014 at 5:27 AM, Michael Van Canneyt
>>  wrote:
>>
>>> Make this a TCollection/TCollectionItem. Generics are not used in the DB
>>> units, and they should not be used for consistency.
>>>
>>
>> But I was thinking that TSqlObjectIdenfier could be reused at Data
>> Dictionary Units. As a TCollectionItem could be harder to reuse, as it
>> will depend of the existence of a TCollection.
>>
>
> I don't understand what you mean with this sentence ?
>
> 1. TCollectionItem can perfectly be used without TCollection.
> 2. You create the collection implicitly with your generic list anyway;
>the exercise is pointless without it; so why not be explicit ?
>
> But if you feel more comforable with a record and an dynamic array: feel
> free to use that. Though I don't see a problem with
> TCollectionItem/TCollection.
> It is used everywhere in the FCL.


... And more an advantage using TOwnedCollection/TCollection: you can show
its properties in object inspector.

-- 
Silvio Clécio
My public projects - github.com/silvioprog
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Database Metadata proposal

2014-06-01 Thread Daniel Gaspary
On Sun, Jun 1, 2014 at 11:18 AM, Michael Van Canneyt
 wrote:
>> But I was thinking that TSqlObjectIdenfier could be reused at Data
>> Dictionary Units. As a TCollectionItem could be harder to reuse, as it
>> will depend of the existence of a TCollection.
>
> I don't understand what you mean with this sentence ?

I was trying to say that I want to use the same
type(TSqlObjectIdenfier) in fpDatadict classes, like TDDTableDef.

> Though I don't see a problem with
> TCollectionItem/TCollection.
> It is used everywhere in the FCL.

I see no problem. It was just a wrong impression that I had about
TCollectionItem.

Thank You Michael.

   Daniel
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Java crash when fpc library CallVoidMethod in a thread.

2014-06-01 Thread fredvs
@ Ewald and Sven => many thanks ;-)

> The ideal thing would be to find some java mechanism that allows him to
>`append` this checksynchronize to `the` main loop, some main-loop hook of
sorts.

Yep, i will be hyper-interested by that feature...

So, until that day will come, i will use a Java-timer in the main thread
(with the littlest reasonable x interval) who will call
CheckSynchronize()...

Many, many thanks for great advices...

Fred.

PS : Sorry to repeat... but fpc native libraries are much more accessible to
Java than equivalent C libraries... => mostly because of Pascal clarity and
huge help from fpc forum. Not sure that already exists C native library
accessible to Java that can do all what fpGUI or uos libraries can do...
(callback procedures, multi threads, dynamically load "classical" other
libraries,...).

Long life to fpc.





-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Java-crash-when-fpc-library-CallVoidMethod-in-a-thread-tp5719098p5719470.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Database Metadata proposal

2014-06-01 Thread Daniel Gaspary
An Issue was created with the patch:

http://bugs.freepascal.org/view.php?id=26254


On Sun, Jun 1, 2014 at 11:28 AM, Daniel Gaspary  wrote:
> I see no problem. It was just a wrong impression that I had about
> TCollectionItem.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Database Metadata proposal

2014-06-01 Thread LacaK

Hi Daniel,
If I understand correctly, when you will use new GetObjectNames then you 
must itterate throught returned collection to obtain "schema names" + 
"object names" (f.e. "table names").


IMO very similar result you can get also with existing implementation, 
when you use:


with SQLQuery1 do begin
 SetSchemaInfo(stTables); // here you can set type of schema query like 
stTables, stColumns, stProcedures, stSchemata etc.

 Open; // here is opened dataset with requested schema query
 while not Eof do begin
   // here you can use FieldByName('SCHAME_NAME').AsString , 
FieldByName('TABLE_NAME').AsString, etc.

   Next;
 end;
end;

-Laco.


An Issue was created with the patch:

http://bugs.freepascal.org/view.php?id=26254


On Sun, Jun 1, 2014 at 11:28 AM, Daniel Gaspary  wrote:
  

I see no problem. It was just a wrong impression that I had about
TCollectionItem.


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

  


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal