Giter VIP home page Giter VIP logo

atlas.cli's People

Contributors

andrewfhart avatar assertchris avatar dhaaker avatar froschdesign avatar harikt avatar jakejohns avatar pmjones avatar shameerc avatar sunkan avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

atlas.cli's Issues

Add option to select a single table to generate classes

Me again. Occasionally, I run the skeleton generator because I updated a table schema. The CLI runs through all tables and generally skips any updates for those that have not changed. The only issue I have is that I sometimes have "extra" tables that I don't need or want classes for, so then I go and delete the generated classes. It might be sort of handy to have an arg to specify which table you want to run the skeleton on. Just a though.

Failure: <table name> not found

Hello gents,

As I try to run atlas-skeleton, I notice that I've received the error as stated above. (Replace <table name> with the name of the table that I'm specifying in the CLI with the --table parameter.)

Failure: <table name> not found

Am I wrong to assume that the table/schema should be created for me? Just wondering if I'm misunderstanding what the package does. Does it rather inspect and build the files based on my own schema? That must be it...

Thanks!

Provide setters for database config

I am currently trying to create a wrapper for Atlas.Cli in my project (which uses Aura.di), so that I don't need to go to vendors folder to generate classes. I am looking for a way to pass the db configuration, which is already defined in config file. Is there a way I can programmatically provide the config rather than using cli options? Or what would be the right way to do it.

Thanks

Support for views

Hey Paul. Hope you are well!
Any thought of adding support for creating mappers for views? Or does this fly in the face of the data mapper as one doesn't modify view records? It's not common, but I do have a case where I want to fetch a related which is a view from another DB. I have a work around in mind, but just curious what your thoughts are.

Jon

Failure: table not found

Hi, just got started with the cli.

Running
./vendor/bin/atlas-skeleton.php --conn=conn.php dir=src/App/DataSource --table=farms App\\DataSources\\Farms

Gives me an error:
--Failure: table 'farms' not found
I checked my database, the tables are there.

I am using pgsql. Here is my conn.php:

<?php

return [
	'pgsql:dbname=mydb;host=localhost;port=5432',
	'root',
	''
];

Atlas Skeleton not running

Okay I have come across this library last night and I have been trying to build my ORM classes from a database using the command below:

lib/bin/atlas-skeleton.php \ --conn=dev/demo/config/conn.php \ --dir=src/App/Domain/Model \ --table=stories Demo\\App\\Domain\\Model\\Story

However, when running this command in Powershell I get the following message:

Please provide a namespace; e.g. App\DataSource\Type.

When I use GitBash I with the same command I get a total different output:

`Generating skeleton data source classes.
Namespace: --conn=dev/demo/config/conn.php
Directory: C:\wamp64\var\www\atlas-core
Skipped: mkdir C:\wamp64\var\www\atlas-core--conn=dev/demo/config/conn.php\

Fatal error: Uncaught exception 'Atlas\Cli\Exception' with message 'file_put_con tents(C:\wamp64\var\www\atlas-core--conn=dev/demo/config/conn.php--conn=dev/de mo/config/conn.phpMapper.php): failed to open stream: No such file or directory' in C:\wamp64\var\www\atlas-core\lib\atlas\cli\src\Fsio.php:71
Stack trace:
#0 C:\wamp64\var\www\atlas-core\lib\atlas\cli\src\Skeleton\Skeleton.php(421): At las\Cli\Fsio->put('C:\wamp64\var\w...', '<?php\nnamespace...')
#1 C:\wamp64\var\www\atlas-core\lib\atlas\cli\src\Skeleton\Skeleton.php(372): At las\Cli\Skeleton\Skeleton->createClass('Mapper', '<?php\nnamespace...')
#2 C:\wamp64\var\www\atlas-core\lib\atlas\cli\src\Skeleton\Skeleton.php(141): At las\Cli\Skeleton\Skeleton->createClasses()
#3 C:\wamp64\var\www\atlas-core\lib\atlas\cli\src\Skeleton\SkeletonCommand.php(2 31): Atlas\Cli\Skeleton\Skeleton->__invoke(Object(Atlas\Cli\Skeleton\SkeletonInp ut))
#4 C:\wamp64\var\www\atlas-core\lib\atlas\cli\src\Skeleton\SkeletonCommand.php(1 41): Atlas\Cli\Skeleton\SkeletonCommand->runSkeleton()
in C:\wamp64\var\www\atlas-core\lib\atlas\cli\src\Fsio.php on line 71
`

Seems like the issue is with the ordering of the command parameters I could be wrong but connection parameter seems to be swiped for the namespace.

What is the correct way of running these command?

Ideas / suggestions needed for extending the template files

Hi @pmjones ,

Lately I have been playing with atlas orm. I / we wished there is some way of flexibility we could bring into the template files.

class {TYPE}Record extends Record
. Example , we plan to extend some classes for generic type of functionality. Say created_at , updated_at etc. Yes, if there is some way like we provide namespace via arguments we could make the change.

Don't feel wrong, that I am asking you to do the same. I understand this can be done as we do like namespace / table name etc via arguments. The problem is when you want to extend different classes the arguments list increases.

Do you think it may be a good idea to use a config file as we do for the connection so things like prefix, namespace etc can be defined there ?

Thank you

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.