-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce remote table entity #4994
Conversation
} from 'src/engine/metadata-modules/remote-server/remote-server.entity'; | ||
|
||
@Entity('remoteTable') | ||
@ObjectType('RemoteTable') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't want ObjectType here, your graphql type is already defined in your dto
|
||
const localTableName = getRemoteTableLocalName(input.name); | ||
|
||
this.validateTableNameDoesNotExists( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing await here?
@@ -104,13 +106,76 @@ export class RemoteTableService { | |||
throw new NotFoundException('Remote server does not exist'); | |||
} | |||
|
|||
const remoteTable = await this.createForeignTableAndMetadata( | |||
if (!input.schema) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's save one query by checking this earlier! 😄
...twenty-server/src/engine/metadata-modules/remote-server/remote-table/remote-table.service.ts
Show resolved
Hide resolved
95601d3
to
2971e62
Compare
We will require remote table entity to map distant table name and local foreign table name. Introducing the entity: - new source of truth to know if a table is sync or not - created synchronously at the same time as metadata and foreign table Adding a few more changes: - exception rather than errors so the user can see these - `pluralize` library that will allow to stop adding `Remote` suffix on names --------- Co-authored-by: Thomas Trompette <[email protected]>
We will require remote table entity to map distant table name and local foreign table name.
Introducing the entity:
Adding a few more changes:
pluralize
library that will allow to stop addingRemote
suffix on names