atlasphp / atlas.cli Goto Github PK
View Code? Open in Web Editor NEWCommand-line tools for Atlas.
License: MIT License
Command-line tools for Atlas.
License: MIT License
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.
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!
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
Just tried running the generator bundled with Cassini v3, and it only picked up the Postgres tables in the public schema. What do I need to do to get the generator to support other schemas?
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
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',
''
];
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?
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.
Atlas.Cli/templates/Record.tpl
Line 9 in 28b09d3
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
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.