Giter Site home page Giter Site logo

slonik-typegen-bug-repro's Introduction

@slonik/typegen Bug Reproduction

See mmkal/slonik-tools#379 for the original issue.

  1. Install CockroachDB (see See https://www.cockroachlabs.com/docs/v21.2/install-cockroachdb-mac.html)
brew install cockroachdb/tap/cockroach
  1. Run a local single-node CRDB instance –
cockroach start-single-node --insecure --listen-addr=localhost --accept-sql-without-tls
  1. If you don't have PostgreSQL installed already (specifically for using the psql tool) –
brew install libpq
echo 'export PATH="/opt/homebrew/opt/libpq/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
  1. Clone this repo, install all dependencies and run the type-generator –
git clone [email protected]:paambaati/slonik-typegen-bug-repro.git
npm i
npm run typegen
  1. See error –
Using default pool config - type parsers will not be respected.
Searching for files matching **/*.{ts,sql} in sql/.
Found 19 files and 10 queries.
/Users/me/Projects/slonik-test/sql/slonik-test.ts:10 Describing query failed: error: type with ID 4294867231 does not exist.
Succesfully processed 9 out of 10 queries in files /Users/me/Projects/slonik-test/sql/1-users.sql,/Users/me/Projects/slonik-test/sql/2-organisations.sql,/Users/me/Projects/slonik-test/sql/3-organisation-users.sql,/Users/me/Projects/slonik-test/sql/4-user-groups.sql,/Users/me/Projects/slonik-test/sql/5-user-group-members.sql,/Users/me/Projects/slonik-test/sql/6-collections.sql,/Users/me/Projects/slonik-test/sql/7-shortcuts.sql,/Users/me/Projects/slonik-test/sql/8-collection-managers.sql,/Users/me/Projects/slonik-test/sql/9-link-permissions.sql .
prettier failed to run; Your output might be ugly! Error below:
Expression expected. (76:5)
  74 |
  75 | export const _queryCache = new Map < string, string;
> 76 |     > ();
     |     ^
  77 |
  78 | export const defaultReadFileSync = (filepath: string) => {
  79 |     const cached = _queryCache.get(filepath);
prettier failed to run; Your output might be ugly! Error below:
Expression expected. (76:5)
  74 |
  75 | export const _queryCache = new Map < string, string;
> 76 |     > ();
     |     ^
  77 |
  78 | export const defaultReadFileSync = (filepath: string) => {
  79 |     const cached = _queryCache.get(filepath);
prettier failed to run; Your output might be ugly! Error below:
Expression expected. (76:5)
  74 |
  75 | export const _queryCache = new Map < string, string;
> 76 |     > ();
     |     ^
  77 |
  78 | export const defaultReadFileSync = (filepath: string) => {
  79 |     const cached = _queryCache.get(filepath);
prettier failed to run; Your output might be ugly! Error below:
Expression expected. (76:5)
  74 |
  75 | export const _queryCache = new Map < string, string;
> 76 |     > ();
     |     ^
  77 |
  78 | export const defaultReadFileSync = (filepath: string) => {
  79 |     const cached = _queryCache.get(filepath);
prettier failed to run; Your output might be ugly! Error below:
Expression expected. (76:5)
  74 |
  75 | export const _queryCache = new Map < string, string;
> 76 |     > ();
     |     ^
  77 |
  78 | export const defaultReadFileSync = (filepath: string) => {
  79 |     const cached = _queryCache.get(filepath);
prettier failed to run; Your output might be ugly! Error below:
Expression expected. (76:5)
  74 |
  75 | export const _queryCache = new Map < string, string;
> 76 |     > ();
     |     ^
  77 |
  78 | export const defaultReadFileSync = (filepath: string) => {
  79 |     const cached = _queryCache.get(filepath);
prettier failed to run; Your output might be ugly! Error below:
Expression expected. (76:5)
  74 |
  75 | export const _queryCache = new Map < string, string;
> 76 |     > ();
     |     ^
  77 |
  78 | export const defaultReadFileSync = (filepath: string) => {
  79 |     const cached = _queryCache.get(filepath);
prettier failed to run; Your output might be ugly! Error below:
Expression expected. (76:5)
  74 |
  75 | export const _queryCache = new Map < string, string;
> 76 |     > ();
     |     ^
  77 |
  78 | export const defaultReadFileSync = (filepath: string) => {
  79 |     const cached = _queryCache.get(filepath);
prettier failed to run; Your output might be ugly! Error below:
Expression expected. (76:5)
  74 |
  75 | export const _queryCache = new Map < string, string;
> 76 |     > ();
     |     ^
  77 |
  78 | export const defaultReadFileSync = (filepath: string) => {
  79 |     const cached = _queryCache.get(filepath);

slonik-typegen-bug-repro's People

Contributors

paambaati avatar

Watchers

 avatar  avatar  avatar

Forkers

mmkal

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.