UNPKG

1.54 kBMarkdownView Raw
1# FoxHound
2
3The FoxHound javascript query generator, for node.js and the browser.
4
5
6### Getting Started
7
8 $ npm install foxhound --save
9
10Then...
11
12 var foxhound = require('foxhound');
13 var my_awesome_query = foxhound.scope('Users').cap(20).generate().query.body;
14 console.log(my_awesome_query);
15
16The default query dialect is english, so, node should output:
17
18 Please give me 20 of your Users. Thank you!
19
20This is not very useful for anything other than testing, so, we might want to change the dialect and try again:
21
22 var foxhound = require('foxhound');
23 var my_awesome_query = foxhound.scope('Users').cap(20).setDialect('MySQL').generate().query.body;
24 console.log(my_awesome_query);
25
26Which now will output:
27
28 SELECT * FROM Users LIMIT 20;
29
30### Testing
31
32 $ npm test
33 $ npm run coverage
34
35### Docker Development Environment
36
37
381. Run this command to build this image:
39```
40docker build ./ -t retold/foxhound:local
41```
42
43alternatively you can use npm to run this
44
45
46```
47npm run docker-dev-build-image
48```
49
502. Run this command to build the local container:
51```
52docker run -it --name foxhound-dev -p 127.0.0.1:12346:8080 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/foxhound" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" retold/foxhound:local
53```
54
55alternatively you can use npm to run this
56
57```
58npm run docker-dev-run
59```
60
613. Go to http://localhost:12346/ in a web browser
62
634. The password is "retold"
64
655. Right now you (may) need to delete the `node_modules` folders and regenerate it for Linux.
\No newline at end of file