laravel-test-factory-helper icon indicating copy to clipboard operation
laravel-test-factory-helper copied to clipboard

Postgres / sqlite support

Open perezale opened this issue 5 years ago • 5 comments

is postgres or sqlite support available? Just tried both with no luck at 'SHOW COLUMNS... ' :cry:

If so, maybe there should be a message in README

perezale avatar Feb 12 '20 17:02 perezale

I'll take a look as I plan to revisit the way these are loaded in the coming weeks.

jasonmccreary avatar Feb 13 '20 02:02 jasonmccreary

great news, just came across this issue.

@jasonmccreary Didn't do a deep dive into the code, but

DB::connection()->getDoctrineSchemaManager()->listTableColumns('users')

gives me the postgres columns via the optional doctrine/dbal package

result:

array:8 [
  "id" => Doctrine\DBAL\Schema\Column {#1305
    #_type: Doctrine\DBAL\Types\BigIntType {#1315}
    #_length: null
    #_precision: 10
    #_scale: 0
    #_unsigned: false
    #_fixed: false
    #_notnull: true
    #_default: null
    #_autoincrement: true
    #_platformOptions: []
    #_columnDefinition: null
    #_comment: null
    #_customSchemaOptions: []
    #_name: "id"
    #_namespace: null
    #_quoted: false
  }
  "name" => Doctrine\DBAL\Schema\Column {#1340
    #_type: Doctrine\DBAL\Types\StringType {#1335}
    #_length: 255
    #_precision: 10
    #_scale: 0
    #_unsigned: false
    #_fixed: false
    #_notnull: true
    #_default: null
    #_autoincrement: false
    #_platformOptions: []
    #_columnDefinition: null
    #_comment: null
    #_customSchemaOptions: []
    #_name: "name"
    #_namespace: null
    #_quoted: false
  }
....

mstaack avatar Feb 19 '20 20:02 mstaack

Are there any updates on the support for postgres? I cant seem to get the package running for my postgers 9.6DB on laravel 6.10. Every time i run the command i get the same error "Could not analyse class []"

Chingoski avatar Mar 03 '20 13:03 Chingoski

Haven't circled back. You're welcome to open a PR.

jasonmccreary avatar Mar 03 '20 14:03 jasonmccreary

@jasonmccreary I have found a possible solution i will try to open an PR later this day or tomorrow.

Chingoski avatar Mar 05 '20 10:03 Chingoski