romanyx / polluter Goto Github PK
View Code? Open in Web Editor NEWThe easiest solution to seed database with Go
License: MIT License
The easiest solution to seed database with Go
License: MIT License
Enable Travis CI for the repository.
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
but instead results in (simply casting the value)
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)
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?
I've been struggling to get this to work with pg jsonb columns. Has anyone figured out?
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!
It would also be cool to have support for Redis hashes and Bolt!
Please add support for mongodb
thanks
The order in files should be respected and saved as it is, to deal with constraints.
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?
It could be cool if we can only import database engine we needed like in golang-migrate.
I can prepare a pull request if you want
プロジェクト間違っため、削除お願いします。
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.
It would be useful to preserve the case of the keys in the seed 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\\\"}"
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)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.