Module: Synthra
- Extended by:
- API
- Defined in:
- lib/synthra.rb,
lib/synthra/api.rb,
lib/synthra/cli.rb,
lib/synthra/field.rb,
lib/synthra/mixin.rb,
lib/synthra/engine.rb,
lib/synthra/errors.rb,
lib/synthra/export.rb,
lib/synthra/limits.rb,
lib/synthra/schema.rb,
lib/synthra/version.rb,
lib/synthra/personas.rb,
lib/synthra/registry.rb,
lib/synthra/scenarios.rb,
lib/synthra/api_server.rb,
lib/synthra/export/csv.rb,
lib/synthra/export/sql.rb,
lib/synthra/lsp/server.rb,
lib/synthra/parser/ast.rb,
lib/synthra/types/base.rb,
lib/synthra/config_file.rb,
lib/synthra/export/base.rb,
lib/synthra/mock_server.rb,
lib/synthra/time_travel.rb,
lib/synthra/types/regex.rb,
lib/synthra/live_preview.rb,
lib/synthra/parser/lexer.rb,
lib/synthra/configuration.rb,
lib/synthra/export/python.rb,
lib/synthra/generator/rng.rb,
lib/synthra/native_engine.rb,
lib/synthra/parser/parser.rb,
lib/synthra/parser/tokens.rb,
lib/synthra/relationships.rb,
lib/synthra/types/formula.rb,
lib/synthra/behaviors/base.rb,
lib/synthra/export/graphql.rb,
lib/synthra/export/openapi.rb,
lib/synthra/repl/formatter.rb,
lib/synthra/types/registry.rb,
lib/synthra/types/scenario.rb,
lib/synthra/types/template.rb,
lib/synthra/database_seeder.rb,
lib/synthra/export/graphviz.rb,
lib/synthra/export/protobuf.rb,
lib/synthra/export/xml_data.rb,
lib/synthra/generator/modes.rb,
lib/synthra/quality_metrics.rb,
lib/synthra/export/json_data.rb,
lib/synthra/export/terraform.rb,
lib/synthra/export/yaml_data.rb,
lib/synthra/generator/engine.rb,
lib/synthra/openapi_importer.rb,
lib/synthra/performance_mode.rb,
lib/synthra/property_testing.rb,
lib/synthra/snapshot_testing.rb,
lib/synthra/type_definitions.rb,
lib/synthra/types/core/enums.rb,
lib/synthra/types/json_array.rb,
lib/synthra/behaviors/failure.rb,
lib/synthra/behaviors/latency.rb,
lib/synthra/cli/commands/base.rb,
lib/synthra/cli/commands/diff.rb,
lib/synthra/cli/commands/docs.rb,
lib/synthra/cli/commands/lint.rb,
lib/synthra/cli/commands/live.rb,
lib/synthra/cli/commands/seed.rb,
lib/synthra/deterministic_ids.rb,
lib/synthra/export/javascript.rb,
lib/synthra/export/sql_insert.rb,
lib/synthra/export/typescript.rb,
lib/synthra/generator/context.rb,
lib/synthra/rails_test_helper.rb,
lib/synthra/schema_versioning.rb,
lib/synthra/webhook_simulator.rb,
lib/synthra/behaviors/registry.rb,
lib/synthra/contracts_registry.rb,
lib/synthra/export/json_schema.rb,
lib/synthra/functions/registry.rb,
lib/synthra/generator/resolver.rb,
lib/synthra/generator/streamer.rb,
lib/synthra/repl/enhanced_repl.rb,
lib/synthra/schema_inheritance.rb,
lib/synthra/cli/commands/export.rb,
lib/synthra/cli/commands/import.rb,
lib/synthra/export/type_mapping.rb,
lib/synthra/migration_generator.rb,
lib/synthra/types/core/defaults.rb,
lib/synthra/types/crypto/crypto.rb,
lib/synthra/types/travel/travel.rb,
lib/synthra/behaviors/applicator.rb,
lib/synthra/behaviors/deprecated.rb,
lib/synthra/generator/uniqueness.rb,
lib/synthra/types/core/sequences.rb,
lib/synthra/types/naughty_string.rb,
lib/synthra/cli/commands/generate.rb,
lib/synthra/cli/commands/validate.rb,
lib/synthra/output/json_formatter.rb,
lib/synthra/types/core/primitives.rb,
lib/synthra/types/core/references.rb,
lib/synthra/types/date_time/dates.rb,
lib/synthra/utils/string_distance.rb,
lib/synthra/activerecord_inference.rb,
lib/synthra/behaviors/partial_data.rb,
lib/synthra/types/core/collections.rb,
lib/synthra/types/core/identifiers.rb,
lib/synthra/types/hostile_payloads.rb,
lib/synthra/documentation_generator.rb,
lib/synthra/factory_bot_integration.rb,
lib/synthra/generator/faker_adapter.rb,
lib/synthra/output/ndjson_formatter.rb,
lib/synthra/types/repeating_element.rb,
lib/synthra/types/text_content/misc.rb,
lib/synthra/validator/dsl_validator.rb,
lib/synthra/behaviors/simulate_error.rb,
lib/synthra/validator/path_validator.rb,
lib/synthra/behaviors/randomize_order.rb,
lib/synthra/export/graphql_federation.rb,
lib/synthra/types/text_content/colors.rb,
lib/synthra/behaviors/close_connection.rb,
lib/synthra/types/personal_names/names.rb,
lib/synthra/types/text_content/business.rb,
lib/synthra/types/text_content/security.rb,
lib/generators/synthra/install_generator.rb,
lib/synthra/types/health_medical/medical.rb,
lib/synthra/types/personal_names/chinese.rb,
lib/synthra/types/finance_banking/banking.rb,
lib/synthra/types/technology_internet/apps.rb,
lib/synthra/types/address_location/airports.rb,
lib/synthra/types/media_entertainment/media.rb,
lib/synthra/types/address_location/addresses.rb,
lib/synthra/types/address_location/locations.rb,
lib/synthra/types/commerce_products/commerce.rb,
lib/synthra/types/commerce_products/products.rb,
lib/synthra/types/personal_names/identifiers.rb,
lib/synthra/types/personal_names/national_id.rb,
lib/synthra/types/commerce_products/companies.rb,
lib/synthra/types/finance_banking/identifiers.rb,
lib/synthra/types/technology_internet/devices.rb,
lib/synthra/types/technology_internet/formats.rb,
lib/synthra/types/finance_banking/credit_cards.rb,
lib/synthra/types/text_content/text_generation.rb,
lib/synthra/types/commerce_products/construction.rb,
lib/synthra/types/personal_names/titles_suffixes.rb,
lib/synthra/types/technology_internet/networking.rb,
lib/synthra/types/address_location/banks_hospitals.rb,
lib/synthra/types/technology_internet/communication.rb
Overview
=============================================================================
Synthra National ID Type Generator
Generates government-issued identifier numbers (SSN, etc.). Format varies by country.
=============================================================================
Defined Under Namespace
Modules: API, Behaviors, CommonMixins, ConfigFile, DeterministicIds, Errors, Export, FactoryBotBridge, FactoryBotIntegration, Functions, Generator, Generators, HostilePayloads, LSP, Mixin, Output, Parser, PerformanceMode, Personas, PropertyTesting, QualityMetrics, REPL, RailsTestHelper, Relationships, Scenarios, SchemaInference, SchemaInheritance, SchemaVersioning, SnapshotTesting, TestHelpers, TimeTravel, Traits, Types, Utils, Validator, WebhookSimulator Classes: APIServer, ActiveRecordInference, CLI, Configuration, ContractError, ContractsRegistry, DatabaseSeeder, DocumentationGenerator, Engine, Error, Field, FieldBehavior, Limits, LivePreview, MigrationGenerator, MockServer, NativeEngine, OpenAPIImporter, Registry, Schema
Constant Summary collapse
- OPTIONAL_FIELD_PRESENCE_RATE =
Probability that an optional field will be included (80%)
0.8- NULLABLE_FIELD_NULL_RATE =
Probability that a nullable field will be null (10%)
0.1- MAX_DSL_FILE_SIZE =
Maximum DSL file size to prevent DoS (10MB)
10 * 1024 * 1024
- MODES =
Valid generation modes, in dispatch order (see Generator::Modes). Exposed so callers can discover the accepted
mode:values instead of guessing. %i[random edge invalid hostile mixed].freeze
- ParseError =
Parsing errors
Errors::ParseError
- SyntaxError =
Errors::SyntaxError
- UnknownTypeError =
Errors::UnknownTypeError
- PathError =
Errors::PathError
- InvalidProbabilityError =
Errors::InvalidProbabilityError
- IndentationError =
Errors::IndentationError
- ValidationError =
Simulyra DSL validation errors
Errors::ValidationError
- SchemaError =
Errors::SchemaError
- ApiError =
Errors::ApiError
- ScenarioError =
Errors::ScenarioError
- ReferenceError =
Errors::ReferenceError
- ContextError =
Errors::ContextError
- GenerationError =
Generation errors
Errors::GenerationError
- UniquenessError =
Errors::UniquenessError
- CyclicReferenceError =
Errors::CyclicReferenceError
- MissingReferenceError =
Errors::MissingReferenceError
- MissingFunctionError =
Errors::MissingFunctionError
- ConditionError =
Errors::ConditionError
- ResourceLimitError =
Resource limit errors
Errors::ResourceLimitError
- LatencyLimitError =
Errors::LatencyLimitError
- RecursionLimitError =
Errors::RecursionLimitError
- ArraySizeLimitError =
Errors::ArraySizeLimitError
- TextLengthLimitError =
Errors::TextLengthLimitError
- SimulatedBehaviorError =
Simulated behavior errors
Errors::SimulatedBehaviorError
- SimulatedFailure =
Errors::SimulatedFailure
- SimulatedConnectionDrop =
Errors::SimulatedConnectionDrop
- SimulatedError =
Errors::SimulatedError
- VERSION =
Current version of the Synthra gem
"0.1.0"
Class Method Summary collapse
-
.[](*args, **options) ⇒ Object
Shorthand accessor.
-
.as(persona_name) { ... } ⇒ Object
Generate data using a persona.
-
.configuration ⇒ Configuration
extended
from API
Returns the global configuration instance.
-
.configure {|Configuration| ... } ⇒ void
extended
from API
Configure Synthra with a block.
-
.configure_test_helper! ⇒ void
Configure Rails test helper.
-
.current_persona ⇒ Personas::PersonaContext?
Get current persona context.
-
.data_export_formats ⇒ Object
extended
from API
List data export formats.
-
.define_factory(factory_name, schema:) { ... } ⇒ void
extended
from API
Define a factory using a Synthra schema.
-
.each_schema {|schema| ... } ⇒ Object
extended
from API
Iterate over all loaded schemas.
-
.export(format, schema, **options) ⇒ Object
extended
from API
Export to any supported format.
-
.export_extension(format) ⇒ Object
extended
from API
Get file extension for export format.
-
.export_filename(schema_name, format) ⇒ Object
extended
from API
Generate auto filename for export.
-
.export_formats ⇒ Object
extended
from API
List available export formats.
-
.export_to_file(format, schema, output_dir: ".", **options) ⇒ Object
extended
from API
Export to file with auto-generated filename.
-
.generate_native(schema_or_dsl, count, seed: nil, locale: "en", threads: nil) ⇒ Array<Hash>
extended
from API
Generate records using native engine.
-
.generate_native_to_file(schema_or_dsl, count, path, seed: nil, locale: "en", format: "jsonl", threads: nil) ⇒ Integer
extended
from API
Generate records to file using native engine.
-
.load(path) ⇒ Schema
extended
from API
Load and parse a single DSL file.
-
.load_all(path) ⇒ Array<Schema>
extended
from API
Load a DSL file and return ALL schemas it defines (not just the first).
-
.load_config_file! ⇒ void
Load configuration from config file on first use.
-
.load_schemas(path) ⇒ Object
extended
from API
Load schemas into default registry for iteration.
-
.native_available? ⇒ Boolean
extended
from API
Check if native Rust engine is available.
-
.native_engine(schema, locale: "en") ⇒ NativeEngine
extended
from API
Create a native engine for a schema.
-
.parse(source) ⇒ Schema
extended
from API
Parse a DSL string and return the first schema.
-
.parse_all(source) ⇒ Array<Schema>
extended
from API
Parse a DSL string and return ALL schemas it defines (not just the first).
- .register_address_types! ⇒ Object private
- .register_advanced_types! ⇒ Object private
-
.register_behavior(name, klass = nil) {|result, context, value| ... } ⇒ void
extended
from API
Register a custom behavior.
-
.register_builtin_types! ⇒ Object
private
Registers all built-in types.
- .register_commerce_types! ⇒ Object private
- .register_core_types! ⇒ Object private
- .register_datetime_types! ⇒ Object private
- .register_finance_types! ⇒ Object private
-
.register_function(name, force: false) {|context| ... } ⇒ void
extended
from API
Register a custom function for computed fields.
- .register_media_types! ⇒ Object private
- .register_personal_types! ⇒ Object private
- .register_technology_types! ⇒ Object private
- .register_text_types! ⇒ Object private
-
.register_type(name, klass = nil) {|rng, context, args, mode| ... } ⇒ void
extended
from API
Register a custom type generator.
-
.registry ⇒ Registry
extended
from API
Access the default registry.
-
.reset_configuration! ⇒ void
extended
from API
Reset configuration to default values.
-
.schema_export_formats ⇒ Object
extended
from API
List schema export formats.
-
.seed_database(**options) { ... } ⇒ Hash
Convenience method for database seeding.
-
.to_csv(schema, registry: nil, count: 10, seed: nil, mode: :random) ⇒ Object
extended
from API
Export generated data as CSV.
-
.to_graphql(schema, registry: nil) ⇒ Object
extended
from API
Export schema to GraphQL.
-
.to_graphql_all(registry) ⇒ Object
extended
from API
Export all schemas to GraphQL.
-
.to_graphviz(schema = nil, registry: nil, direction: "LR", group: false) ⇒ Object
extended
from API
Export schema to GraphViz DOT format.
-
.to_javascript(schema, registry: nil) ⇒ Object
extended
from API
Export schema to JavaScript with JSDoc.
-
.to_javascript_all(registry) ⇒ Object
extended
from API
Export all schemas to JavaScript.
-
.to_json(schema, registry: nil, count: 10, seed: nil, mode: :random, pretty: true, envelope: nil) ⇒ Object
extended
from API
Export generated data as JSON.
-
.to_json_schema(schema, registry: nil) ⇒ Object
extended
from API
Export schema to JSON Schema format.
-
.to_python(schema, registry: nil, style: :pydantic) ⇒ Object
extended
from API
Export schema to Python.
-
.to_python_all(registry, style: :pydantic) ⇒ Object
extended
from API
Export all schemas to Python.
-
.to_sql(schema, registry: nil, dialect: :postgresql) ⇒ Object
extended
from API
Export schema to SQL CREATE TABLE.
-
.to_sql_all(registry, dialect: :postgresql) ⇒ Object
extended
from API
Export all schemas to SQL.
-
.to_sql_insert(schema, registry: nil, count: 10, seed: nil, dialect: :postgresql, batch_insert: false) ⇒ Object
extended
from API
Export generated data as SQL INSERT statements.
-
.to_typescript(schema, registry: nil, comments: false) ⇒ Object
extended
from API
Export schema to TypeScript interface.
-
.to_typescript_all(registry) ⇒ Object
extended
from API
Export all schemas to TypeScript.
-
.to_xml(schema, registry: nil, count: 10, seed: nil, root: nil, item: nil) ⇒ Object
extended
from API
Export generated data as XML.
-
.to_yaml(schema, registry: nil, count: 10, seed: nil, root_key: nil) ⇒ Object
extended
from API
Export generated data as YAML.
Class Method Details
.[](*args, **options) ⇒ Object
Shorthand accessor
243 244 245 246 247 248 249 |
# File 'lib/synthra/engine.rb', line 243 def Synthra.[](*args, **) if args.length == 1 generate(args.first.to_s, **) else args.map { |name| generate(name.to_s, **) } end end |
.as(persona_name) { ... } ⇒ Object
Generate data using a persona
382 383 384 |
# File 'lib/synthra/personas.rb', line 382 def as(persona_name, &block) Personas.as(persona_name, &block) end |
.configuration ⇒ Configuration Originally defined in module API
Returns the global configuration instance
.configure {|Configuration| ... } ⇒ void Originally defined in module API
This method returns an undefined value.
Configure Synthra with a block
.configure_test_helper! ⇒ void
This method returns an undefined value.
Configure Rails test helper
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/synthra/rails_test_helper.rb', line 232 def configure_test_helper! return unless defined?(Rails) # Auto-load schemas from standard locations schema_paths = [ Rails.root.join("schemas"), Rails.root.join("test/schemas"), Rails.root.join("spec/schemas") ] @default_registry ||= Registry.new schema_paths.each do |path| @default_registry.load_dir(path.to_s) if path.exist? end end |
.current_persona ⇒ Personas::PersonaContext?
Get current persona context
390 391 392 |
# File 'lib/synthra/personas.rb', line 390 def current_persona Thread.current[:synthra_persona] end |
.data_export_formats ⇒ Object Originally defined in module API
List data export formats
.define_factory(factory_name, schema:) { ... } ⇒ void Originally defined in module API
This method returns an undefined value.
Define a factory using a Synthra schema
.each_schema {|schema| ... } ⇒ Object Originally defined in module API
Iterate over all loaded schemas
.export(format, schema, **options) ⇒ Object Originally defined in module API
Export to any supported format
.export_extension(format) ⇒ Object Originally defined in module API
Get file extension for export format
.export_filename(schema_name, format) ⇒ Object Originally defined in module API
Generate auto filename for export
.export_formats ⇒ Object Originally defined in module API
List available export formats
.export_to_file(format, schema, output_dir: ".", **options) ⇒ Object Originally defined in module API
Export to file with auto-generated filename
.generate_native(schema_or_dsl, count, seed: nil, locale: "en", threads: nil) ⇒ Array<Hash> Originally defined in module API
Generate records using native engine
.generate_native_to_file(schema_or_dsl, count, path, seed: nil, locale: "en", format: "jsonl", threads: nil) ⇒ Integer Originally defined in module API
Generate records to file using native engine
.load_all(path) ⇒ Array<Schema> Originally defined in module API
Load a DSL file and return ALL schemas it defines (not just the first).
.load_config_file! ⇒ void
This method returns an undefined value.
Load configuration from config file on first use
221 222 223 224 225 226 |
# File 'lib/synthra.rb', line 221 def load_config_file! @config_loaded ||= begin ConfigFile.load_and_apply true end end |
.load_schemas(path) ⇒ Object Originally defined in module API
Load schemas into default registry for iteration
.native_available? ⇒ Boolean Originally defined in module API
Check if native Rust engine is available
.native_engine(schema, locale: "en") ⇒ NativeEngine Originally defined in module API
Create a native engine for a schema
.parse(source) ⇒ Schema Originally defined in module API
Parse a DSL string and return the first schema
.parse_all(source) ⇒ Array<Schema> Originally defined in module API
Parse a DSL string and return ALL schemas it defines (not just the first).
parse/load return a single schema for convenience, which silently drops the rest of a
multi-schema file. Use these when a source may define more than one schema.
.register_address_types! ⇒ Object (private)
.register_advanced_types! ⇒ Object (private)
260 261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/synthra/type_definitions.rb', line 260 def register_advanced_types! # Date/Time register_datetime_types! # Advanced types Types::Registry.register("formula", Types::Formula) Types::Registry.register("json_array", Types::JsonArray) Types::Registry.register("naughty_string", Types::NaughtyString) Types::Registry.register("regex", Types::Regex) Types::Registry.register("repeating_element", Types::RepeatingElement) Types::Registry.register("scenario", Types::Scenario) Types::Registry.register("template", Types::Template) end |
.register_behavior(name, klass = nil) {|result, context, value| ... } ⇒ void Originally defined in module API
This method returns an undefined value.
Register a custom behavior
.register_builtin_types! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Registers all built-in types
This method is called automatically when the gem loads.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/synthra/type_definitions.rb', line 18 def self.register_builtin_types! register_core_types! register_personal_types! register_commerce_types! register_finance_types! register_address_types! register_technology_types! register_text_types! register_media_types! register_advanced_types! end |
.register_commerce_types! ⇒ Object (private)
.register_core_types! ⇒ Object (private)
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/synthra/type_definitions.rb', line 33 def register_core_types! # Require core type files require_relative "types/core/identifiers" require_relative "types/core/primitives" require_relative "types/core/collections" require_relative "types/core/references" require_relative "types/core/sequences" require_relative "types/core/defaults" require_relative "types/core/enums" # Identifiers Types::Registry.register("uuid", Types::Core::Uuid) Types::Registry.register("ulid", Types::Core::Ulid) Types::Registry.register("id_sequence", Types::Core::IdSequence) Types::Registry.register("snowflake_id", Types::Core::SnowflakeId) Types::Registry.register("unix_timestamp_ms", Types::Core::UnixTimestampMs) Types::Registry.register("numeric_string_id", Types::Core::NumericStringId) Types::Registry.register("alphanumeric_id", Types::Core::AlphanumericId) Types::Registry.register("locale", Types::Core::Locale) Types::Registry.register("token", Types::Core::Token) # Primitives Types::Registry.register("text", Types::Core::Text) Types::Registry.register("string", Types::Core::Text) # alias for OpenAPI/contract compatibility Types::Registry.register("number", Types::Core::Number) Types::Registry.register("boolean", Types::Core::Boolean) Types::Registry.register("const", Types::Core::Const) # Collections Types::Registry.register("array", Types::Core::ArrayType) Types::Registry.register("object", Types::Core::ObjectType) Types::Registry.register("map_by_field", Types::Core::MapByField) Types::Registry.register("one_of", Types::Core::OneOf) Types::Registry.register("enum", Types::Core::Enum) # References and sequences Types::Registry.register("sequence", Types::Core::Sequence) Types::Registry.register("default_value", Types::Core::DefaultValue) Types::Registry.register("reference", Types::Core::Reference) Types::Registry.register("custom", Types::Core::Custom) Types::Registry.register("copy", Types::Core::Copy) Types::Registry.register("shared", Types::Core::Shared) Types::Registry.register("character_sequence", Types::Core::CharacterSequence) Types::Registry.register("digit_sequence", Types::Core::DigitSequence) # Simulyra DSL schema reference type Types::Registry.register("schema_ref", Types::Core::SchemaRef) end |
.register_datetime_types! ⇒ Object (private)
249 250 251 252 253 254 255 256 257 258 |
# File 'lib/synthra/type_definitions.rb', line 249 def register_datetime_types! Types::Registry.register("date", Types::DateTime::DateType) Types::Registry.register("past_date", Types::DateTime::PastDate) Types::Registry.register("future_date", Types::DateTime::FutureDate) Types::Registry.register("now", Types::DateTime::Now) Types::Registry.register("timestamp", Types::DateTime::Timestamp) Types::Registry.register("time", Types::DateTime::TimeType) Types::Registry.register("datetime", Types::DateTime::DatetimeType) Types::Registry.register("date_between", Types::DateTime::DateBetween) end |
.register_finance_types! ⇒ Object (private)
.register_function(name, force: false) {|context| ... } ⇒ void Originally defined in module API
This method returns an undefined value.
Register a custom function for computed fields
.register_media_types! ⇒ Object (private)
244 245 246 247 |
# File 'lib/synthra/type_definitions.rb', line 244 def register_media_types! Types::Registry.register("movie_genres", Types::MediaEntertainment::MovieGenres) Types::Registry.register("movie_title", Types::MediaEntertainment::MovieTitle) end |
.register_personal_types! ⇒ Object (private)
.register_technology_types! ⇒ Object (private)
.register_text_types! ⇒ Object (private)
.register_type(name, klass = nil) {|rng, context, args, mode| ... } ⇒ void Originally defined in module API
This method returns an undefined value.
Register a custom type generator
.reset_configuration! ⇒ void Originally defined in module API
This method returns an undefined value.
Reset configuration to default values
.schema_export_formats ⇒ Object Originally defined in module API
List schema export formats
.seed_database(**options) { ... } ⇒ Hash
Convenience method for database seeding
263 264 265 266 |
# File 'lib/synthra/database_seeder.rb', line 263 def seed_database(**, &block) seeder = DatabaseSeeder.new(**) seeder.seed(&block) end |
.to_csv(schema, registry: nil, count: 10, seed: nil, mode: :random) ⇒ Object Originally defined in module API
Export generated data as CSV
.to_graphql(schema, registry: nil) ⇒ Object Originally defined in module API
Export schema to GraphQL
.to_graphql_all(registry) ⇒ Object Originally defined in module API
Export all schemas to GraphQL
.to_graphviz(schema = nil, registry: nil, direction: "LR", group: false) ⇒ Object Originally defined in module API
Export schema to GraphViz DOT format
.to_javascript(schema, registry: nil) ⇒ Object Originally defined in module API
Export schema to JavaScript with JSDoc
.to_javascript_all(registry) ⇒ Object Originally defined in module API
Export all schemas to JavaScript
.to_json(schema, registry: nil, count: 10, seed: nil, mode: :random, pretty: true, envelope: nil) ⇒ Object Originally defined in module API
Export generated data as JSON
.to_json_schema(schema, registry: nil) ⇒ Object Originally defined in module API
Export schema to JSON Schema format
.to_python(schema, registry: nil, style: :pydantic) ⇒ Object Originally defined in module API
Export schema to Python
.to_python_all(registry, style: :pydantic) ⇒ Object Originally defined in module API
Export all schemas to Python
.to_sql(schema, registry: nil, dialect: :postgresql) ⇒ Object Originally defined in module API
Export schema to SQL CREATE TABLE
.to_sql_all(registry, dialect: :postgresql) ⇒ Object Originally defined in module API
Export all schemas to SQL
.to_sql_insert(schema, registry: nil, count: 10, seed: nil, dialect: :postgresql, batch_insert: false) ⇒ Object Originally defined in module API
Export generated data as SQL INSERT statements
.to_typescript(schema, registry: nil, comments: false) ⇒ Object Originally defined in module API
Export schema to TypeScript interface
.to_typescript_all(registry) ⇒ Object Originally defined in module API
Export all schemas to TypeScript
.to_xml(schema, registry: nil, count: 10, seed: nil, root: nil, item: nil) ⇒ Object Originally defined in module API
Export generated data as XML
.to_yaml(schema, registry: nil, count: 10, seed: nil, root_key: nil) ⇒ Object Originally defined in module API
Export generated data as YAML