Skip to content
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

Custom Primary Key/Id #755

Open
mitchwd opened this issue Nov 14, 2022 · 1 comment
Open

Custom Primary Key/Id #755

mitchwd opened this issue Nov 14, 2022 · 1 comment

Comments

@mitchwd
Copy link

mitchwd commented Nov 14, 2022

Hey team,
Love the snowfakery tool, and use it often.
I'm working in a non-Salesforce env, and looking to generate a UUID4 as the id primary key, rather than an incrementing integer.
Is this possible, or are you aware of any possible workarounds?

Thanks,
Mitch

@mitchwd
Copy link
Author

mitchwd commented Nov 14, 2022

Ah, looks like simply overriding the id sort of works, except when using random references...
Scenario 1: One object, overriding the id:

- object: city
  count: 3
  fields:
    id: 
      fake: uuid4
    name:
      fake: firstName

Output: Works, but generates duplicate id columns. (One can be stripped manually)

Scenario 2: Two objects, parent/child:

- object: city
  count: 3
  fields:
    id: 
      fake: uuid4
    name:
      fake: city
   __people:
    - object: people
      count: 10
      fields:
        id: 
          fake: uuid4
       name: firstName
       city: 
         reference: city

Output: Works, but generates duplicate id columns.

Scenario 3: Two objects, with random_reference:

- object: city
  count: 3
  fields:
    id: 
      fake: uuid4
    name:
      fake: city
- object: people
  count: 10
  fields:
    id: 
      fake: uuid4
   name: firstName
   city: 
     random_reference: city

Output:

An error occurred. If you would like to see a Python traceback, use the --debug-internals option.
Error: Problem rendering value : '<' not supported between instances of 'str' and 'int'

:( Any tips on getting this third scenario to function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant