pub fn print_script(args: &Args) {
    let schema_name = QName::parse(&args.schema_name).expect("invalid schema name");
    let quoted_schema_name = shlex::quote(&args.schema_name);

    let meta_seed = args.seed.unwrap_or_else(|| OsRng.gen());
    println!(
        "#!/bin/sh\n\
         # generated by dbschemagen v{} ({}), using seed {}\n\n\
         set -eu\n\
         echo 'CREATE SCHEMA '{}';' > {}-schema-create.sql\n",
        env!("CARGO_PKG_VERSION"),
        env!("VERGEN_GIT_SHA").get(..9).unwrap_or("unofficial release"),
        meta_seed,
        quoted_schema_name,
        schema_name.unique_name(),
    );

    let exe_suffix = if cfg!(windows) { ".exe" } else { "" };

    let rng = meta_seed.make_rng();
    let extra_args = args.args.iter().map(|s| shlex::quote(s)).collect::<Vec<_>>().join(" ");
    let rows_count_per_file = args.rows_count * args.inserts_count;
    for (i, table) in gen_tables(args.dialect, rng, args.size, args.tables_count).enumerate() {
        println!(
            "# table: s{}, rows count: {}, estimated size: {}\n\
             dbgen{} -i - -o . -s {} -t {}.s{} -R {} -r {} -N {} \
             {} <<SCHEMAEOF\n{}\nSCHEMAEOF\n",
            i,
            table.rows_count,
            to_human_size(table.target_size),
            exe_suffix,
            table.seed,
            quoted_schema_name,
            i,
            rows_count_per_file,
            args.rows_count,
            table.rows_count,
            extra_args,
            table.schema,
        );
    }
}
/// Generates a shell script for invoking `dbgen` into stdout.
Generates a shell script for invoking `dbgen` into stdout.
Generates a shell script for invoking ` dbgen ` into stdout .
pub fn print_script(args: &Args) {
    let schema_name = QName::parse(&args.schema_name).expect("invalid schema name");
    let quoted_schema_name = shlex::quote(&args.schema_name);
    let meta_seed = args.seed.unwrap_or_else(|| OsRng.gen());
    println!(
        "#!/bin/sh\n\
         # generated by dbschemagen v{} ({}), using seed {}\n\n\
         set -eu\n\
         echo 'CREATE SCHEMA '{}';' > {}-schema-create.sql\n",
        env!("CARGO_PKG_VERSION"),
        env!("VERGEN_GIT_SHA").get(..9).unwrap_or("unofficial release"),
        meta_seed,
        quoted_schema_name,
        schema_name.unique_name(),
    );
    let exe_suffix = if cfg!(windows) { ".exe" } else { "" };
    let rng = meta_seed.make_rng();
    let extra_args = args.args.iter().map(|s| shlex::quote(s)).collect::<Vec<_>>().join(" ");
    let rows_count_per_file = args.rows_count * args.inserts_count;
    for (i, table) in gen_tables(args.dialect, rng, args.size, args.tables_count).enumerate() {
        println!(
            "# table: s{}, rows count: {}, estimated size: {}\n\
             dbgen{} -i - -o . -s {} -t {}.s{} -R {} -r {} -N {} \
             {} <<SCHEMAEOF\n{}\nSCHEMAEOF\n",
            i,
            table.rows_count,
            to_human_size(table.target_size),
            exe_suffix,
            table.seed,
            quoted_schema_name,
            i,
            rows_count_per_file,
            args.rows_count,
            table.rows_count,
            extra_args,
            table.schema,
        );
    }
}
pub fn print_script ( args : & Args ) { let schema_name = QName :: parse ( & args . schema_name ) . expect ( " " ) ; let quoted_schema_name = shlex :: quote ( & args . schema_name ) ; let meta_seed = args . seed . unwrap_or_else ( | | OsRng . gen ( ) ) ; println ! ( " \n \
 \n \n \
 \n \
 \n " env ( " " ) env ( " " ) get ( 9 ) unwrap_or ( " " ) meta_seed quoted_schema_name schema_name unique_name ( ) ) ; let exe_suffix = if cfg ! ( windows ) { " " } else { " " } ; let rng = meta_seed . make_rng ( ) ; let extra_args = args . args . iter ( ) . map ( | s | shlex :: quote ( s ) ) . collect :: < Vec < _ > > ( ) . join ( " " ) ; let rows_count_per_file = args . rows_count * args . inserts_count ; for ( i , table ) in gen_tables ( args . dialect , rng , args . size , args . tables_count ) . enumerate ( ) { println ! ( " \n \
 \
 \n \n \n " i table rows_count to_human_size ( table target_size ) exe_suffix table seed quoted_schema_name i rows_count_per_file args rows_count table rows_count extra_args table schema ) ; } }
Generates a shell script for invoking `dbgen` into stdout.
Generates a shell script for invoking ` dbgen ` into stdout .
args
&Args
args
&Args