Skip to content

基于spring-jdbc生态的(No-ORM)DBUtil,兼容各种数据库。动态注册切换数据源,快速执行DDL DML。读写表结构、索引等元数据。常用于动态结构的场景,如:可视化动态多数据源、低代码后台、异构数据库迁移同步、物联网车联网数据处理、数据清洗、运行时自定义表单/查询条件/数据结构、爬虫数据解析、自定义报表 等,只需要一个注解即可与springboot,mvc等框架项目完美整合。

License

Notifications You must be signed in to change notification settings

itsharex/anyline

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EN doc CN doc

Dynamically register and switch data sources during runtime, automatically generate SQL (DDL/DML/DQL), read and write metadata, and compare database structure differences. Adapt to over 100 relational/non relational databases. Commonly used for low-level support in dynamic scenarios, such as data middleware, visualization, low code backend, workflow, custom forms, heterogeneous database migration and synchronization, IoT vehicle data processing, data cleaning, runtime custom reports/query conditions/data structures, crawling insect data parsing, etc

Quick test refer【anyline-simple-clear】
Syntax refer【anyline-simple】

any questions, please contact skype: [email protected]

QQ群(86020680) 微信群 过期请联系管理员
regardless of bugs, doubts, requirements, source code, competitors

Introduction

The core of AnyLine is a runtime oriented metadata dynamic relationship mapping primarily used for

  • Dynamically register and switch data sources
  • Read and write metadata
  • Compare database structure differences
  • Generate dynamic SQL and combine dynamic query conditions
  • Complex result set operations

A natural low code, dynamic form, and dynamic data source underlying tool

Adapt to various relational and non relational databases (as well as various domestic niche databases)
Commonly used for low-level support in dynamic structural scenarios, appearing as an SQL parsing engine or adapter
Such as: data center, visualization, low code, SAAS, custom forms, heterogeneous database migration and synchronization, IoT vehicle networking data processing
Conditions/data structures, crawler data parsing, etc.
Reference [Applicable Scenarios

Data source registration and switching

Note that the data source here is not a master-slave relationship, but multiple completely unrelated data sources.

DataSource ds_sso = new DruidDataSource();
ds_sso.setUrl("jdbc:mysql://localhost:3306/sso");
ds_sso.setDriverClassName("com.mysql.cj.jdbc.Driver");
...
DataSourceHolder.reg("ds_sso", ds_sso);
OR  
DataSourceHolder.reg("ds_sso", pool, driver, url, user, password);
DataSourceHolder.reg("ds_sso", Map<String, Object> params); //Corresponding properties of the connection pool k-v

//Query the SSO_USER table of the ds_Sso data source
DataSet set = ServiceProxy.service("ds_sso").querys("SSO_USER");

From static configuration file data source (if it is a Spring environment, it can be in Spring format)

#Default Data Source
anyline.datasource.type=com.zaxxer.hikari.HikariDataSource
anyline.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
anyline.datasource.url=jdbc:mysql://localhost:33306/simple
anyline.datasource.user-name=root
... more parameters
#Other data sources
anyline.datasource-list=crm,erp,sso,mg

anyline.datasource.crm.driver-class-name=com.mysql.cj.jdbc.Driver
anyline.datasource.crm.url=jdbc:mysql://localhost:33306/simple_crm
anyline.datasource.crm.username=root

anyline.datasource.erp.driver-class-name=com.mysql.cj.jdbc.Driver
anyline.datasource.erp.url=jdbc:mysql://localhost:33306/simple_erp
anyline.datasource.erp.username=root

DML

// If it is a web environment
service.querys("SSO_USER", 
   condition(true, "NAME:%name%", "TYPE:[type]", "[CODES]:code"));
//true Indicates the need for pagination, and conditions without parameter values are ignored by default
//SQL:
SELECT * 
FROM SSO_USER 
WHERE 1=1 
AND NAME LIKE '%?%' 
AND TYPE IN(?,?,?)
AND FIND_IN_SET(?, CODES)	
LIMIT 5,10 //Generate different SQL statements based on specific database types

//User defined query conditions, low code scenarios generally require more complex query conditions
ConfigStore configs;
service.query("SSO_USER", configs);
//ConfigStore provides all SQL operations
//Sample code and instructions for SQL parameters for multi table, batch submission, custom SQL, and parsing XML definitions

Read and write metadata

@Autowired("anyline.service")
AnylineService service;

//Query the SSO_USER table structure of the default data source
Table table = serivce.metadata().table("SSO_USER");
LinkedHashMap<String, Column> columns = table.getColumns();                 //columns of Table
LinkedHashMap<String, Constraint> constraints = table.getConstraints();     //constraints of table
List<String> ddls = table.getDdls();                                        //ddl for create table

//drop table and recreate
service.ddl().drop(table);
table = new Table("SSO_USER");

//The data type here is arbitrary, regardless of whether it is int8 or bigint, it will be converted to the correct type during execution
table.addColumn("ID", "BIGINT").autoIncrement(true).setPrimary(true).setComment("primary key");
table.addColumn("CODE", "VARCHAR(20)").setComment("code of user");
table.addColumn("NAME", "VARCHAR(20)").setComment("full name");
table.addColumn("AGE", "INT").setComment("age of user");
service.ddl().create(table);

//or service.ddl().save(table);  //During execution, it will distinguish which columns need to be added and which columns need to be altered

Database transactions

//Because the method can switch data sources multiple times at any time, the annotation can no longer capture the current data source
//More transaction parameters can be obtained through the TransactionDefine parameter
TransactionState state = TransactionProxy.start("ds_sso"); 
//Operational data(insert update delete)
TransactionProxy.commit(state);
TransactionProxy.rollback(state);

MYSQLMYSQL PostgreSQLPostgreSQL ORACLEORACLE MSSQLMSSQL MongoDBMongoDB RedisRedis ElasticSearchElasticSearch DB2DB2 DMDM(武汉达梦数据库股份有限公司) GBase8aGBase8a(天津南大通用数据技术股份有限公司) GBase8cGBase8c(天津南大通用数据技术股份有限公司) GBase8sGBase8s(天津南大通用数据技术股份有限公司) oscaroscar SQLiteSQLite SnowflakeSnowflake CassandraCassandra MariaDBMariaDB SplunkSplunk AzureSQLAzureSQL AmazonDynamoDBAmazonDynamoDB DatabricksDatabricks HiveHive AccessAccess GoogleBigQueryGoogleBigQuery HighGoHighGo(瀚高基础软件股份有限公司) MSSQL2000MSSQL2000 Neo4jNeo4j PolarDBPolarDB(阿里云计算有限公司) SybaseSybase TeraDataTeraData FileMakerFileMaker HANAHANA SolrSolr AdaptiveAdaptive HbaseHbase AzureCosmosAzureCosmos InfluxDBInfluxDB PostGISPostGIS AzureSynapseAzureSynapse FirebirdFirebird CouchbaseCouchbase AmazonRedshiftAmazonRedshift InformixInformix MemcachedMemcached SparkSpark Cloudera Cloudera FirebaseFirebase ClickHouseClickHouse PrestoPresto VerticaVertica dbasedbase NetezzaNetezza OpenSearchOpenSearch FlinkFlink CouchDBCouchDB GoogleFirestoreGoogleFirestore GreenplumGreenplum AmazonAuroraAmazonAurora H2H2 KdbKdb etcdetcd RealmRealm MarkLogicMarkLogic HazelcastHazelcast PrometheusPrometheus OracleEssbaseOracleEssbase DatastaxDatastax AerospikeAerospike AzureDataExplorerAzureDataExplorer AlgoliaAlgolia EhcacheEhcache DerbyDerby CockroachDBCockroachDB ScyllaDBScyllaDB AzureSearchAzureSearch InterbaseInterbase AzureTableStorageAzureTableStorage SphinxSphinx JackrabbitJackrabbit TrinoTrino SingleStoreSingleStore IngresIngres VirtuosoVirtuoso TimescaleTimescale GoogleDatastoreGoogleDatastore GraphiteGraphite HyperSQLHyperSQL AdabasAdabas RiakKVRiakKV SAPIQSAPIQ ArangoDBArangoDB JenaJena IgniteIgnite GoogleBigtableGoogleBigtable TiDBTiDB(PingCAP) AccumuloAccumulo RocksDBRocksDB OracleNoSQLOracleNoSQL OpenEdgeOpenEdge DuckDBDuckDB DolphinDBDolphinDB GemFireGemFire OrientDBOrientDB GoogleSpannerGoogleSpanner RavenDBRavenDB AnywhereAnywhere CacheCache ChinaMobileDBChinaMobileDB ChinaUnicomDBChinaUnicomDB CirroDataCirroData FusionInsightFusionInsight GaiaDBGaiaDB GaussDB100GaussDB100 GaussDB200GaussDB200 GoldenDBGoldenDB GreatDBGreatDB(北京万里开源软件有限公司) HashDataHashData HotDBHotDB InfinispanInfinispan KingBaseKingBase(北京人大金仓信息技术股份有限公司) LightDBLightDB MogDBMogDB(云和恩墨) MuDBMuDB(沐融信息科技) RapidsDBRapidsDB SelectDBSelectDB SinoDBSinoDB StarDBStarDB UbiSQLUbiSQL UXDBUXDB(北京优炫软件股份有限公司) VastbaseVastbase(北京海量数据技术股份有限公司) xigemaDBxigemaDB YiDBYiDB xuguxugu(成都虚谷伟业科技有限公司) MaxDBMaxDB CloudantCloudant OracleBerkeleyOracleBerkeley YugabyteDBYugabyteDB LevelDBLevelDB PineconePinecone HEAVYAIHEAVYAI MemgraphMemgraph CloudKitCloudKit RethinkDBRethinkDB EXASOLEXASOL DrillDrill PouchDBPouchDB PhoenixPhoenix EDBEDB TDengineTDengine IRISIRIS RRDtoolRRDtool GraphDBGraphDB CitusCitus CoveoCoveo IMSIMS LMDBLMDB NebulaNebula AmazonNeptuneAmazonNeptune OracleCoherenceOracleCoherence GeodeGeode AmazonSimpleDBAmazonSimpleDB PerconaMySQLPerconaMySQL AmazonCloudSearchAmazonCloudSearch StardogStardog FireboltFirebolt DatomicDatomic SpatiaLiteSpatiaLite MonetDBMonetDB jBASEjBASE BaseXBaseX ChromaChroma EmpressEmpress AmazonDocumentDBAmazonDocumentDB JanusGraphJanusGraph MnesiaMnesia TiberoTibero QuestDBQuestDB GridDBGridDB TigerGraphTigerGraph Db4oDb4o WeaviateWeaviate TarantoolTarantool GridGainGridGain DgraphDgraph SQLBaseSQLBase OpenTSDBOpenTSDB SednaSedna OceanBaseOceanBase FaunaFauna DatameerDatameer PlanetScalePlanetScale ActianNoSQLActianNoSQL TimesTenTimesTen VoltDBVoltDB FoundationDBFoundationDB InfobrightInfobright Db2WarehouseDb2Warehouse NonStopSQLNonStopSQL ObjectStoreObjectStore mSQLmSQL LiteDBLiteDB MilvusMilvus DataEaseDataEase CubridCubrid D3D3 VictoriaMetricsVictoriaMetrics kylinkylin GiraphGiraph GTMGTM ObjectBoxObjectBox HFSQLHFSQL MeilisearchMeilisearch MatrixOneMatrixOne PerstPerst OracleRdbOracleRdb GigaSpacesGigaSpaces VitessVitess RealityReality SQLJSSQLJS EzmeralEzmeral AllegroGraphAllegroGraph M3DBM3DB HAWQHAWQ StarRocksStarRocks solidDBsolidDB NuoDBNuoDB NCacheNCache OpenGaussOpenGauss IoTDBIoTDB QdrantQdrant Model204Model204 ZODBZODB BigchainDBBigchainDB SurrealDBSurrealDB XapianXapian DBISAMDBISAM ActianVectorActianVector HibariHibari DoltDolt TypeDBTypeDB AltibaseAltibase AmazonTimestreamAmazonTimestream ObjectDBObjectDB BlazegraphBlazegraph AmazonKeyspacesAmazonKeyspaces TDSQLTDSQL(腾讯云计算(北京)有限责任公司) IDMSIDMS RDF4JRDF4J GeoMesaGeoMesa eXistdbeXistdb eXtremeScaleeXtremeScale RocksetRockset YellowbrickYellowbrick SQreamSQream DatacomDBDatacomDB TypesenseTypesense MapDBMapDB ObjectivityDBObjectivityDB CrateDBCrateDB eXtremeeXtreme SciDBSciDB AlaSQLAlaSQL KairosDBKairosDB KineticaKinetica MaxComputeMaxCompute KeyDBKeyDB OpenInsightOpenInsight AnalyticDBMySQLAnalyticDBMySQL GemStoneSGemStoneS ValdVald DorisDoris ScaleArcScaleArc RisingWaveRisingWave FrontBaseFrontBase PostgresXLPostgresXL PinotPinot HeroicHeroic VistaDBVistaDB ScalarisScalaris NexusDBNexusDB PerconaMongoDBPerconaMongoDB GraphEngineGraphEngine BoltDBBoltDB atotiatoti VespaVespa LokiJSLokiJS RaimaRaima DatabendDatabend RBASERBASE RedlandRedland HarperDBHarperDB SpliceMachineSpliceMachine AnalyticDBPostgreSQLAnalyticDBPostgreSQL ModeShapeModeShape StrabonStrabon JadeJade SequoiadbSequoiadb CnosDBCnosDB ITTIAITTIA EllipticsElliptics ElassandraElassandra RasdamanRasdaman SearchBloxSearchBlox InfiniteGraphInfiniteGraph ApsaraDBPolarDBApsaraDBPolarDB StarcounterStarcounter AxibaseAxibase KyligenceKyligence FeatureBaseFeatureBase LovefieldLovefield VoldemortVoldemort BrytlytBrytlyt MachbaseNeoMachbaseNeo ActianFastObjectsActianFastObjects OpenQMOpenQM RDFoxRDFox AnzoGraph_DBAnzoGraph_DB FlureeFluree ImmudbImmudb Mimer_SQLMimer_SQL YDBYDB RedStoreRedStore HyperGraphDBHyperGraphDB MarqoMarqo EJDBEJDB TajoTajo DeepLakeDeepLake AntDBAntDB LeanXcaleLeanXcale MulgaraMulgara FujitsuFujitsu FlockDBFlockDB STSdbSTSdb PieCloudDBPieCloudDB TransbaseTransbase ElevateDBElevateDB RiakTSRiakTS FaircomDBFaircomDB NEventStoreNEventStore Comdb2Comdb2 YottaDBYottaDB QuasardbQuasardb SpeedbSpeedb EsgynDBEsgynDB ComputeDBComputeDB HugeGraphHugeGraph ValentinaValentina PipelineDBPipelineDB BangdbBangdb DydraDydra TinkerGraphTinkerGraph EventStoreEventStore UltipaUltipa Table_StoreTable_Store ActianPSQLActianPSQL CubicWebCubicWeb ExorbyteExorbyte GraphBaseGraphBase TokyoTyrantTokyoTyrant SkytableSkytable TerminusDBTerminusDB BadgerBadger GreptimeDBGreptimeDB TransLatticeTransLattice ArcadeDBArcadeDB KunDBKunDB SparkseeSparksee MyScaleMyScale BigObjectBigObject LinterLinter ManticoreSearchManticoreSearch DragonflyDragonfly TigrisTigris H2GISH2GIS VelocityDBVelocityDB EloqueraEloquera HyperLevelDBHyperLevelDB XTDBXTDB BluefloodBlueflood SenseiDBSenseiDB TSDBTSDB TerarkDBTerarkDB OrigoDBOrigoDB TomP2PTomP2P XtremeDataXtremeData SiaqodbSiaqodb YTsaurusYTsaurus WarpWarp openGeminiopenGemini UpscaledbUpscaledb gStoregStore OushuDBOushuDB IndicaIndica BrightstarDBBrightstarDB InfinityDBInfinityDB NosDBNosDB HippoHippo AcebaseAcebase SiriDBSiriDB SiteWhereSiteWhere ArgoDBArgoDB NSDbNSDb JaguarDBJaguarDB WakandaDBWakandaDB StellarDBStellarDB GalaxybaseGalaxybase DataFSDataFS SadasEngineSadasEngine HawkularHawkular AgensGraphAgensGraph FaircomEDGEFaircomEDGE CachelotCachelot iBoxDBiBoxDB StateServerStateServer TkrzwTkrzw SWCDBSWCDB LedisDBLedisDB SwayDBSwayDB NewtsNewts ActorDBActorDB IntelligenceIntelligence SmallSQLSmallSQL SpaceTimeSpaceTime SparkleDBSparkleDB ResinCacheResinCache JethroDataJethroData BergDBBergDB CortexDBCortexDB CovenantSQLCovenantSQL DaggerDBDaggerDB EdgelessDBEdgelessDB HeliumHelium HGraphDBHGraphDB JasDBJasDB RaptorDBRaptorDB RizhiyiRizhiyi searchxmlsearchxml BadgerDBBadgerDB CayleyCayley CraseCrase CrispICrispI GraphPortalGraphPortal GrinnGrinn ODABAODABA OWASPOWASP reldbreldb VoracityVoracity ZeroMQZeroMQ

About

基于spring-jdbc生态的(No-ORM)DBUtil,兼容各种数据库。动态注册切换数据源,快速执行DDL DML。读写表结构、索引等元数据。常用于动态结构的场景,如:可视化动态多数据源、低代码后台、异构数据库迁移同步、物联网车联网数据处理、数据清洗、运行时自定义表单/查询条件/数据结构、爬虫数据解析、自定义报表 等,只需要一个注解即可与springboot,mvc等框架项目完美整合。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%