{"id":16193614,"url":"https://github.com/pyramation/faker","last_synced_at":"2025-09-10T22:41:45.388Z","repository":{"id":66351065,"uuid":"318345811","full_name":"pyramation/faker","owner":"pyramation","description":"create fake data in PostgreSQL","archived":false,"fork":false,"pushed_at":"2020-12-04T01:10:11.000Z","size":546,"stargazers_count":28,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T02:03:51.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyramation.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-03T23:20:38.000Z","updated_at":"2024-11-24T13:20:08.000Z","dependencies_parsed_at":"2023-02-21T12:45:58.505Z","dependency_job_id":null,"html_url":"https://github.com/pyramation/faker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Ffaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Ffaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Ffaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Ffaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyramation","download_url":"https://codeload.github.com/pyramation/faker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675597,"owners_count":20977378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T08:15:48.389Z","updated_at":"2025-04-07T15:21:14.375Z","avatar_url":"https://github.com/pyramation.png","language":"PLpgSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# faker [![Build Status](https://travis-ci.com/pyramation/faker.svg?branch=master)](https://travis-ci.com/pyramation/faker)\n\ncreate fake data in PostgreSQL\n\n# Usage\n\n## state, city, zip\n\n```sql\nselect faker.state();\n-- CA\n\nselect faker.city();\n-- Belle Haven\n\nselect faker.city('MI');\n-- Livonia\n\nselect faker.zip();\n-- 48105\n\nselect faker.zip('Los Angeles');\n-- 90272\n```\n\n## address, street\n\n```sql\nselect faker.address();\n-- 762 MESA ST         \n-- Fort Mohave, AZ 86427\n\nselect faker.address('MI');\n-- 2316 LAPHAM WAY           \n-- Sterling Heights, MI 48312\n\nselect faker.street();\n-- CLAY ST\n```\n\n## tags\n\nTags can be seeded in `faker.dictionary` table, here's an example with sustainability \n\n```sql\nselect faker.tags();\n-- {\"causes of global warming\",\"electronic waste\",\"solar powered cars\"}\n```\n\n## words\n\n```sql\nselect faker.word();\n-- woodpecker\n```\n\nSpecify word types\n\n```sql\nselect faker.word(ARRAY['adjectives']);\n-- decisive\n```\n\n## paragraphs\n\n```sql\nselect faker.paragraph();\n-- Ligula. Aliquet torquent consequat egestas dui. Nullam sed tincidunt mauris porttitor ad taciti rutrum eleifend. Phasellus.\n```\n\n## email\n\n```sql\nselect faker.email();\n-- crimson79@hotmail.com\n```\n\n## uuid\n\n```sql\nselect faker.uuid();\n-- 327cb21d-1680-47ee-9979-3689e1bcb9ab\n```\n\n## tokens, passwords\n\n```sql\nselect faker.token();\n-- 9e23040a7825529beb1528c957eac73f\n\nselect faker.token(20);\n-- 7504ef4eafbba04a9645198b10ebc9616afce13a\n\nselect faker.password();\n-- d8f1cca306e4d7^15bb(62618c1e\n```\n\n## hostname\n\n```sql\nselect faker.hostname();\n-- fine.net\n```\n\n## time unit\n\n```sql\nselect faker.time_unit();\n-- hour\n```\n\n## float\n\n```sql\nselect faker.float();\n-- 64.6970694223782\n\nselect faker.float(2.3,10.5);\n-- 10.233102884792025\n```\n\n## integer\n\n```sql\nselect faker.integer();\n-- 8\n\nselect faker.integer(2,10);\n-- 7\n```\n\n## date\n\n```sql\nselect faker.date();\n-- 2020-10-02\n```\n\nDate 1-3 days ago\n\n```sql\nselect faker.date(1,3);\n-- 2020-12-02\n```\n\nDate in the future between 1-3 days\n\n```sql\nselect faker.date(1,3, true);\n-- 2020-12-06\n```\n\n## birthdate\n\n```sql\nselect faker.birthdate();\n-- 2007-02-24\n```\n\nGenerate birthdate for somebody who is between age of 37 and 64\n\n```sql\nselect faker.birthdate(37, 64);\n-- 1972-08-10\n```\n\n## interval\n\n```sql\nselect faker.interval();\n-- 00:01:34.959831\n```\n\nGenerate an interval between 2 and 300 seconds\n\n```sql\nselect faker.interval(2,300);\n-- 00:01:04\n```\n\n## gender\n\n```sql\nselect faker.gender();\n-- F\n\nselect faker.gender();\n-- M\n```\n\n## boolean\n\n```sql\nselect faker.boolean();\n-- TRUE\n```\n\n## timestamptz\n\n```sql\nselect faker.timestamptz();\n-- 2019-12-20 15:57:29.520365+00\n```\n\nFuture timestamptz\n\n```sql\nselect faker.timestamptz(TRUE);\n-- 2020-12-03 23:00:10.013301+00\n-- \n```\n\n## mime types\n\n```sql\nselect faker.mime();\n-- text/x-scss\n```\n\n## file extensions\n\n```sql\nselect faker.ext();\n-- html\n```\n\nSpecify a mimetype\n\n```sql\nselect faker.ext('image/png');\n-- png\n```\n\nImage mimetypes\n\n```sql\nselect faker.image_mime();\n-- image/gif\n```\n\n## image\n\n```sql\nselect faker.image();\n-- {\"url\": \"https://picsum.photos/843/874\", \"mime\": \"image/gif\"}\n```\n\n## profilepic\n\ncredit: thank you https://randomuser.me \n\n```sql\nselect faker.profilepic();\n-- {\"url\": \"https://randomuser.me/api/portraits/women/53.jpg\", \"mime\": \"image/jpeg\"}\n```\n\nSpecify a gender\n\n```sql\nselect faker.profilepic('M');\n-- {\"url\": \"https://randomuser.me/api/portraits/men/4.jpg\", \"mime\": \"image/jpeg\"}\n```\n\n## file\n\n```sql\nselect faker.file();\n-- scarlet.jpg\n```\n\nSpecify a mimetype\n\n```sql\nselect faker.file('image/png');\n-- anaconda.png\n```\n\n## url\n\n```sql\nselect faker.url();\n-- https://australian.io/copper.gzip\n```\n\n## upload\n\n```sql\nselect faker.upload();\n-- https://magenta.co/moccasin.yaml\n```\n\n## attachment\n\n```sql\nselect faker.attachment();\n--  {\"url\": \"https://silver.io/sapphire.jsx\", \"mime\": \"text/jsx\"}\n```\n\n## phone\n\n```sql\nselect faker.phone();\n-- +1 (121) 617-3329\n```\n\n## ip\n\n```sql\nselect faker.ip();\n-- 42.122.9.119\n```\n\n## username\n\n```sql\nselect faker.username();\n-- amaranth28\n```\n\n## name\n\n```sql\nselect faker.name();\n-- Lindsay\n```\n\nSpecify a gender\n\n```sql\nselect faker.name('M');\n-- Stuart\n\nselect faker.name('F');\n-- Shelly\n```\n\n## surname\n\n```sql\nselect faker.surname();\n-- Smith\n```\n\n## fullname\n\n```sql\nselect faker.fullname();\n-- Ross Silva\n\nselect faker.fullname('M');\n-- George Spencer\n```\n\n## business\n\n```sql\nselect faker.business();\n-- Seed Partners, Co.\n```\n\n## longitude / latitude coordinates\n\n```sql\nselect faker.lnglat( -118.561721, 33.59, -117.646374, 34.23302 );\n-- (-118.33162189532844,34.15614699957491)\n\nselect faker.lnglat();\n-- (-74.0205,40.316)\n```\n\n# Development\n\n## start the postgres db process\n\nFirst you'll want to start the postgres docker (you can also just use `docker-compose up -d`):\n\n```sh\nmake up\n```\n\n## install modules\n\nInstall modules\n\n```sh\nyarn install\n```\n\n## install the Postgres extensions\n\nNow that the postgres process is running, install the extensions:\n\n```sh\nmake install\n```\n\nThis basically `ssh`s into the postgres instance with the `packages/` folder mounted as a volume, and installs the bundled sql code as pgxn extensions.\n\n## testing\n\nTesting will load all your latest sql changes and create fresh, populated databases for each sqitch module in `packages/`.\n\n```sh\nyarn test:watch\n```\n\n## building new modules\n\nCreate a new folder in `packages/`\n\n```sh\nlql init\n```\n\nThen, run a generator:\n\n```sh\nlql generate\n```\n\nYou can also add arguments if you already know what you want to do:\n\n```sh\nlql generate schema --schema myschema\nlql generate table --schema myschema --table mytable\n```\n\n## deploy code as extensions\n\n`cd` into `packages/\u003cmodule\u003e`, and run `lql package`. This will make an sql file in `packages/\u003cmodule\u003e/sql/` used for `CREATE EXTENSION` calls to install your sqitch module as an extension.\n\n## recursive deploy\n\nYou can also deploy all modules utilizing versioning as sqtich modules. Remove `--createdb` if you already created your db:\n\n```sh\nlql deploy awesome-db --yes --recursive --createdb\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyramation%2Ffaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyramation%2Ffaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyramation%2Ffaker/lists"}