@oino-ts/types 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,8 +18,7 @@ export declare abstract class OINOBlob extends OINODataSource {
18
18
  * @param params blob storage connection parameters
19
19
  */
20
20
  constructor(params: OINOBlobParams);
21
- printTableName(name: string): string;
22
- printColumnName(name: string): string;
21
+ printColumnName(column: string): string;
23
22
  printCellAsValue(cellValue: OINODataCell, _sqlType: string): string;
24
23
  printStringValue(s: string): string;
25
24
  parseValueAsCell(v: OINODataCell, nativeType: string): OINODataCell;
@@ -38,6 +38,8 @@ export type OINOApiParams = {
38
38
  hashidLength?: number;
39
39
  /** Make hashids static per row/table */
40
40
  hashidStaticIds?: boolean;
41
+ /** Defaults to api name but should be set to a domain unique value among those apis that need hashids to be compatible (e.g. hashid of a foreign key works in the main api) */
42
+ hashidDomain?: string;
41
43
  /** Name of field that has the modified field */
42
44
  cacheModifiedField?: string;
43
45
  /** Return inserted id values */
@@ -51,10 +51,10 @@ export declare class OINODataField {
51
51
  */
52
52
  printCellAsValue(cellVal: OINODataCell): string;
53
53
  /**
54
- * Print name of column as SQL.
54
+ * Print name of the field in datasource specific format.
55
55
  *
56
56
  */
57
- printColumnName(): string;
57
+ printFieldName(): string;
58
58
  }
59
59
  /**
60
60
  * Specialised class for a string column.
@@ -25,28 +25,21 @@ export declare abstract class OINODataSource {
25
25
  */
26
26
  abstract disconnect(): Promise<void>;
27
27
  /**
28
- * Print a table name using database specific SQL escaping.
28
+ * Print a column name with correct datasource specific formatting.
29
29
  *
30
- * @param sqlTable name of the table
30
+ * @param column name of the column
31
31
  *
32
32
  */
33
- abstract printTableName(sqlTable: string): string;
34
- /**
35
- * Print a column name with correct SQL escaping.
36
- *
37
- * @param sqlColumn name of the column
38
- *
39
- */
40
- abstract printColumnName(sqlColumn: string): string;
33
+ abstract printColumnName(column: string): string;
41
34
  /**
42
35
  * Print a single data value from serialization using the context of the native data
43
36
  * type with the correct SQL escaping.
44
37
  *
45
38
  * @param cellValue data from sql results
46
- * @param sqlType native type name for table column
39
+ * @param nativeType native type name for table column
47
40
  *
48
41
  */
49
- abstract printCellAsValue(cellValue: OINODataCell, sqlType: string): string;
42
+ abstract printCellAsValue(cellValue: OINODataCell, nativeType: string): string;
50
43
  /**
51
44
  * Print a single string value as valid sql literal
52
45
  *
@@ -59,10 +52,10 @@ export declare abstract class OINODataSource {
59
52
  * type.
60
53
  *
61
54
  * @param sqlValue data from serialization
62
- * @param sqlType native type name for table column
55
+ * @param nativeType native type name for table column
63
56
  *
64
57
  */
65
- abstract parseValueAsCell(sqlValue: OINODataCell, sqlType: string): OINODataCell;
58
+ abstract parseValueAsCell(sqlValue: OINODataCell, nativeType: string): OINODataCell;
66
59
  /**
67
60
  * Initialize a data model by getting the SQL schema and populating OINODataFields of
68
61
  * the model.
@@ -30,6 +30,13 @@ export declare abstract class OINODb extends OINODataSource {
30
30
  *
31
31
  */
32
32
  abstract sqlExec(sql: string): Promise<OINODataSet>;
33
+ /**
34
+ * Print a table name using database specific SQL escaping.
35
+ *
36
+ * @param sqlTable name of the table
37
+ *
38
+ */
39
+ abstract printTableName(sqlTable: string): string;
33
40
  /**
34
41
  * Print SQL select statement with DB specific formatting.
35
42
  *
@@ -29,8 +29,7 @@ export declare abstract class OINONoSql extends OINODataSource {
29
29
  * @param params nosql storage connection parameters
30
30
  */
31
31
  constructor(params: OINONoSqlParams);
32
- printTableName(name: string): string;
33
- printColumnName(name: string): string;
32
+ printColumnName(column: string): string;
34
33
  printCellAsValue(cellValue: OINODataCell, nativeType: string): string;
35
34
  printStringValue(s: string): string;
36
35
  parseValueAsCell(v: OINODataCell, nativeType: string): OINODataCell;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oino-ts/types",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "OINO TS package for types.",
5
5
  "author": "Matias Kiviniemi (pragmatta)",
6
6
  "license": "MPL-2.0",