Git Product home page Git Product logo

polluter's People

Contributors

romanyx avatar ryantking avatar secretworry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

polluter's Issues

Travis CI

Enable Travis CI for the repository.

Bytea type doesn't work

I can't seem to seed columns of type bytea. The parser treats the string I provide as "literal" instead of the raw hex bytes:

foo:
    hash: fb1d2d7b10245525cb347e3e38ebc07f27335972d20555a737847640c10c74a6

should insert in the database
image
but instead results in (simply casting the value)
image
The best way to solve this is to provide an escape hatch, just like https://github.com/go-testfixtures/testfixtures (the 0x binary prefix, as well as the RAW= functionality)
image

Support for PostgreSQL arrays.

I'm trying insert with yaml data a product list. Each product have a categories array. When i pollute the data, i got this error:

exec failed: exec: sql: converting argument $4 type: unsupported type []interface {}, a slice of interface

Supports Polluter the PostgreSQL arrays?

Issues with PG Jsonb

I've been struggling to get this to work with pg jsonb columns. Has anyone figured out?

Release new version with MySQL fix

Currently manually pointing dep at the specific revision, would love if you could create a new release with the MySQL back tick fix.

Great library, thanks!

Respect the order

The order in files should be respected and saved as it is, to deal with constraints.

Can't insert in Mysql table

Hi,
I can't insert data into my table called option in MySQL, as option is reserved.
Name should either be quoted or prepended with db name.
Is there any way I can get around this?

pgsql + yaml order respect

Hi,

the problem in your previous issue #3 is still exists with pgsql + yaml.
The input order kept with pg + json.
Here is the input and the command slice output

IN:

member:
    - id: 1
member_role:
    - id: 1
member_token:
    - id: 1
messenger_application:
    - id: 1
organization:
    - id: 1
bot:
    - id: 1
      organization_id: 1

OUT:

INSERT INTO bot ...
INSERT INTO member ... 
INSERT INTO member_role ...
INSERT INTO member_token ...
INSERT INTO messenger_application ...
INSERT INTO organization ...

The problem is with j, err := yaml.YAMLToJSON(data) in yaml.go, after this conversion the output is in alphabetical order.

Preserve case

It would be useful to preserve the case of the keys in the seed file.

Escaping problem for text with escaped quotes in yaml file

The self-crafted YAML-to-JSON converter in YAML parser doesn't handle the escaping properly, thus to use text with double quotes we have to double escape. e.g.
Instead of using

objects:
  - json_data: "{\"key\": \"value\"}"

we have to use

objects:
  - json_data: "{\\\"key\\\":\\\"value\\\"}"

v1.2.2 Fixtures not loading with Postgres driver

Hello! I trying to load fixture into the Postgres database. Unfortunately there are no data after runnig something like this and also I did not get any kind of errors. No data event if I not use txdb.

db, cleanup := preparePG(t)

seed, err := os.Open("../fixtures/users.yml")
if err != nil {
	t.Fatalf("failed to open seed file: %s", err)
}
defer seed.Close()
p := polluter.New(polluter.PostgresEngine(db))
if err := p.Pollute(seed); err != nil {
	t.Fatalf("failed to pollute: %s", err)
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.