-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Server-side map filtering with widgets (#797)
- Loading branch information
Showing
15 changed files
with
494 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Enum for the different connections providers | ||
* @enum {string} | ||
* @readonly | ||
*/ | ||
export const Provider = Object.freeze({ | ||
BigQuery: 'bigquery', | ||
Redshift: 'redshift', | ||
Postgres: 'postgres', | ||
Snowflake: 'snowflake', | ||
Databricks: 'databricks' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export enum Provider { | ||
BigQuery = 'bigquery', | ||
Redshift = 'redshift', | ||
Postgres = 'postgres', | ||
Snowflake = 'snowflake', | ||
Databricks = 'databricks' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { Provider } from "@carto/react-core" | ||
|
||
export type Fragment = { | ||
name: string, | ||
quoted: boolean | ||
} | ||
export type GetIdentifierOptions = { | ||
quoted?: boolean, | ||
safe?: boolean | ||
} | ||
|
||
export type GetObjectIdentifierOptions = GetIdentifierOptions & { | ||
suffix?: string | ||
} | ||
|
||
export enum ParsingMode { | ||
LeftToRight = 'leftToRight', | ||
RightToLeft = 'rightToLeft' | ||
} | ||
|
||
export class FullyQualifiedName { | ||
protected databaseFragment: Fragment | null | ||
protected schemaFragment: Fragment | null | ||
protected objectFragment: Fragment | null | ||
|
||
protected provider: Provider | ||
protected originalFQN: string | ||
protected parsingMode: ParsingMode | ||
|
||
static empty (provider: Provider, mode: ParsingMode): FullyQualifiedName | ||
|
||
constructor (fqn: string, provider: Provider, mode?: ParsingMode) | ||
|
||
public toString (): string | ||
|
||
public getDatabaseName<Safe extends boolean> (options: { quoted?: boolean, safe: Safe }): Safe extends true ? string | null : string | ||
public getDatabaseName (options?: GetIdentifierOptions): string | ||
public getDatabaseName (options?: GetIdentifierOptions): string | null | ||
|
||
public getSchemaName<Safe extends boolean> (options: { quoted?: boolean, safe: Safe }): Safe extends true ? string | null : string | ||
public getSchemaName (options?: GetIdentifierOptions): string | ||
public getSchemaName (options?: GetIdentifierOptions): string | null | ||
|
||
public getObjectName<Safe extends boolean> (options: { quoted?: boolean, safe: Safe, suffix?: string }): Safe extends true ? string | null : string | ||
public getObjectName (options?: GetObjectIdentifierOptions): string | ||
public getObjectName (options?: GetObjectIdentifierOptions): string | null | boolean | ||
|
||
public setDatabaseName (databaseName: string): void | ||
|
||
public setSchemaName (schemaName: string): void | ||
|
||
public setObjectName (objectName: string): void | ||
|
||
private parseFQN (fqn: string): Array<Fragment | null> | ||
|
||
private getFragmentName (fragment: Fragment): string | ||
|
||
private quoteFragmentName (fragment: Fragment, suffix): string | ||
|
||
private unquoteFragmentName (fragment: Fragment, suffix): string | ||
|
||
private isQuotedName (name: string): boolean | ||
|
||
private quoteName (name: string): string | ||
|
||
private unquoteName (name: string, onlyDelimiters): string | ||
|
||
private quoteExternalIdentifier (identifier: string): string | ||
} |
Oops, something went wrong.