Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nilswald committed Oct 26, 2023
1 parent 042e753 commit e6faeaa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
12 changes: 6 additions & 6 deletions functions/SFmSchema/json/F1SFmSChema.json_v1.fmfn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* F1SFmDatabase.schemaJson( _tables; _options )
/* F1SFmSchema.json( _tables; _options )
@about output detailled schema info as json
@author Nils Waldherr <nils.waldherr@fmgarage.com>
@copyright ©2023 FMGARAGE.com
Expand Down Expand Up @@ -28,7 +28,7 @@ Case(
*/
Case(
// write cache
IsEmpty( $$SFmSchema.json ) or Position( _options; "nocache"; 1; 1 );
IsEmpty( $$F1SFmSchema.json ) or Position( _options; "nocache"; 1; 1 );
Let(
[
// settings
Expand Down Expand Up @@ -234,15 +234,15 @@ Case(
];
json
);
$$SFmSchema.json = json
$$F1SFmSchema.json = json
];
""
)
)
& Case(
Position( _options; "format"; 1; 1 ) and not IsEmpty( $$SFmSchema.json );
JSONFormatElements( $$SFmSchema.json );
$$SFmSchema.json
Position( _options; "format"; 1; 1 ) and not IsEmpty( $$F1SFmSchema.json );
JSONFormatElements( $$F1SFmSchema.json );
$$F1SFmSchema.json
)
)

16 changes: 14 additions & 2 deletions functions/SFmSchema/json/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
## SFmSchema.json() Custom Function

This Custom Function returns available information on the schema of the file by integrating the data from sources like the internal FileMaker_Tables and FileMaker_Fields tables and the functions FieldType(), FieldComment() and NextSerialValue().

You can filter tables and fields for instance to get only the standard fields where information is stored originally.



### Parameters



#### _tables

This can be used to filter tables in the current file. You can use list of table names and even wildcards.

Example: providing "Global¶C*" returns the table 'Global' along with all other tables starting with 'C'



#### _options

You can provide one or more keywords to specify the output:
Expand All @@ -20,6 +30,8 @@ You can provide one or more keywords to specify the output:
- comments: includes the field comment from the field definitions.
- nextvalue: includes the next value for auto-incrementing fields like numeric ids.



### Result

The result is a json object with the table names as keys. Every table then is an object with can have the following keys:
Expand All @@ -31,7 +43,7 @@ The result is a json object with the table names as keys. Every table then is an
- modCount: number of changes applied to the field's definition
- isStored: only for calculation fields if the value is stored
- repCount: only for repeating fields
- nextValue: optional result from GetNextSerialValue() function.
- nextValue: optional result from NextSerialValue() function.
- comment: comment from field definitions, null values are omitted.
- debugFromFunction: result from Get( FieldType ) function.
- debugFromFunction: result from FieldType()) function.
- debugFromSql: row from internal FileMaker_Fields table

0 comments on commit e6faeaa

Please sign in to comment.